OpenNuvoton / NUC970_Linux_Kernel

Linux Kernel Source Code for NUC970 Series Microprocessor
Other
68 stars 69 forks source link

open irda port report msb_index() bug #10

Closed junwushi closed 6 years ago

junwushi commented 7 years ago

i am use uart5 connect IRDA transceiver chip. after open("/dev/ttyS5") and setbaud() etc. parameter final use ioctl(irda_fd, TIOCSETD, &irdadisc); irdadisc is N_IRDA. but the kernal report below message:

[ 107.190000] msb_index(), Detected buggy peer, adjust null PV to 0x1!

what 's happend?

and when close the uart, report NULL pointer error:

[ 147.440000] Unable to handle kernel NULL pointer dereference at virtual address 0000005c [ 147.440000] pgd = c0004000 [ 147.440000] [0000005c] *pgd=00000000 [ 147.440000] Internal error: Oops: 17 [#1] PREEMPT ARM [ 147.440000] Modules linked in: [ 147.440000] CPU: 0 PID: 809 Comm: example Not tainted 3.10.106-00958-g463d5e33639-dirty #162 [ 147.440000] task: c34be960 ti: c3656000 task.ti: c3656000 [ 147.440000] PC is at nuc970serial_stop_tx+0x30/0x74 [ 147.440000] LR is at uart_stop+0x44/0x68 [ 147.440000] pc : [] lr : [] psr: 60000093 [ 147.440000] sp : c3657db8 ip : c3657dc8 fp : c3657dc4 [ 147.440000] r10: 00000005 r9 : c3656000 r8 : 00000000 [ 147.440000] r7 : c3582a18 r6 : c36798c0 r5 : a0000013 r4 : c3656000 [ 147.440000] r3 : f8000500 r2 : 00000000 r1 : 00000000 r0 : c0603484 [ 147.440000] Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user [ 147.440000] Control: 0005317f Table: 036e0000 DAC: 00000015 [ 147.440000] Process example (pid: 809, stack limit = 0xc36561b8) [ 147.440000] Stack: (0xc3657db8 to 0xc3658000) [ 147.440000] 7da0: c3657ddc c3657dc8 [ 147.440000] 7dc0: c0218ad8 c021cd84 c3582a00 c371f9a0 c3657dec c3657de0 c0280cb8 c0218aa4 [ 147.440000] 7de0: c3657e04 c3657df0 c0206388 c0280ca0 c3582a00 c3582a00 c3657e2c c3657e08 [ 147.440000] 7e00: c02066e4 c0206344 00000000 c3582a00 c36798c0 c05a6008 00000000 c3656000 [ 147.440000] 7e20: c3657e44 c3657e30 c02077b0 c02066cc c3582a00 00000000 c3657ed4 c3657e48 [ 147.440000] 7e40: c01ffe74 c0207790 c3657e84 00000000 c3582aa8 00000000 00000120 00000001 [ 147.440000] 7e60: c003af1c 00000000 c3657e68 c3657e68 c003af1c c36c3e04 c3657e94 c3657e88 [ 147.440000] 7e80: c0074f28 c003af44 c3657eb4 00000001 c36798c8 00000008 c0075400 00000000 [ 147.440000] 7ea0: 00000000 a9b379c6 c34e38d0 c36798c0 c3022c38 c34e38d0 00000000 c36b0540 [ 147.440000] 7ec0: c36b0540 00000008 c3657f14 c3657ed8 c00c7938 c01ffad8 00000000 00000000 [ 147.440000] 7ee0: c00e45bc c36798c8 c3657f0c 00000000 c34be960 00000000 c05f6188 c373b480 [ 147.440000] 7f00: c373b4bc 00000000 c3657f24 c3657f18 c00c7b60 c00c78b4 c3657f44 c3657f28 [ 147.440000] 7f20: c003ae48 c00c7b60 c373b480 c34be960 4294ddb8 c3656000 c3657f7c c3657f48 [ 147.440000] 7f40: c0021ecc c003adb0 000000f8 00000000 c3656000 00000000 c3657f7c c3657f68 [ 147.440000] 7f60: c0449784 c04491bc c3656000 000000f8 c3657f94 c3657f80 c00233c0 c0021c5c [ 147.440000] 7f80: bed8ff29 42960f00 c3657fa4 c3657f98 c0023470 c002338c 00000000 c3657fa8 [ 147.440000] 7fa0: c000ef00 c0023468 bed8ff29 42960f00 0000007f bed8f420 0000000a 0000007f [ 147.440000] 7fc0: bed8ff29 42960f00 4294ddb8 000000f8 bed8fac0 4294dcf0 bed8fb84 bed8fb6c [ 147.440000] 7fe0: bed8f658 bed8f65c 42940488 4294a074 60000010 0000007f 00000000 00000000 [ 147.440000] Backtrace: [ 147.440000] [] (nuc970serial_stop_tx+0x0/0x74) from [] (uart_stop+0x44/0x68) [ 147.440000] [] (uart_stop+0x0/0x68) from [] (nuc970irda_close+0x28/0x2c) [ 147.440000] r5:c371f9a0 r4:c3582a00 [ 147.440000] [] (nuc970irda_close+0x0/0x2c) from [] (tty_ldisc_close+0x54/0x6c) [ 147.440000] [] (tty_ldisc_close+0x0/0x6c) from [] (tty_ldisc_kill+0x28/0x138) [ 147.440000] r5:c3582a00 r4:c3582a00 [ 147.440000] [] (tty_ldisc_kill+0x0/0x138) from [] (tty_ldisc_release+0x30/0x50) [ 147.440000] r9:c3656000 r8:00000000 r7:c05a6008 r6:c36798c0 r5:c3582a00 r4:00000000 [ 147.440000] [] (tty_ldisc_release+0x0/0x50) from [] (tty_release+0x3ac/0x654) [ 147.440000] r5:00000000 r4:c3582a00 [ 147.440000] [] (tty_release+0x0/0x654) from [] (fput+0x94/0x274) [ 147.440000] [] (fput+0x0/0x274) from [] (fput+0x10/0x14) [ 147.440000] [] (fput+0x0/0x14) from [] (task_work_run+0xa8/0xbc) [ 147.440000] [] (task_work_run+0x0/0xbc) from [] (do_exit+0x280/0x948) [ 147.440000] r7:c3656000 r6:4294ddb8 r5:c34be960 r4:c373b480 [ 147.440000] [] (do_exit+0x0/0x948) from [] (do_group_exit+0x44/0xdc) [ 147.440000] r7:000000f8 [ 147.440000] [] (do_group_exit+0x0/0xdc) from [] (SyS_exit_group+0x18/0x1c) [ 147.440000] r5:42960f00 r4:bed8ff29 [ 147.440000] [] (SyS_exit_group+0x0/0x1c) from [] (ret_fast_syscall+0x0/0x34) [ 147.440000] Code: 0a000002 e3c22002 e5903004 e5832004 (e5d1305c) [ 147.440000] ---[ end trace c076684beba376ea ]--- [ 147.440000] Fixing recursive fault but reboot is needed!

junwushi commented 7 years ago

i use your bsp provided demos name irda_demos ,it is show same issue,pls check soon. thanks. root@HHT:~# chmod +x irda_demo root@HHT:~# ./irda_demo [ 260.150000] msb_index(), Detected buggy peer, adjust null PV to 0x1!

^C[ 284.180000] Unable to handle kernel NULL pointer dereference at virtual address 0000005c [ 284.180000] pgd = c0004000 [ 284.180000] [0000005c] *pgd=00000000 [ 284.180000] Internal error: Oops: 17 [#1] PREEMPT ARM [ 284.180000] Modules linked in: [ 284.180000] CPU: 0 PID: 814 Comm: irda_demo Not tainted 3.10.106-00958-g463d5e33639-dirty #162 [ 284.180000] task: c34a35e0 ti: c36ee000 task.ti: c36ee000 [ 284.180000] PC is at nuc970serial_stop_tx+0x30/0x74 [ 284.180000] LR is at uart_stop+0x44/0x68 [ 284.180000] pc : [] lr : [] psr: 60000093 [ 284.180000] sp : c36efdb8 ip : c36efdc8 fp : c36efdc4 [ 284.180000] r10: 00000005 r9 : c36ee000 r8 : 00000000 [ 284.180000] r7 : c36c1c18 r6 : c342ad20 r5 : a0000013 r4 : c36ee000 [ 284.180000] r3 : f8000500 r2 : 00000000 r1 : 00000000 r0 : c0603484 [ 284.180000] Flags: nZCv IRQs off FIQs on Mode SVC_32 ISA ARM Segment user [ 284.180000] Control: 0005317f Table: 0370c000 DAC: 00000015 [ 284.180000] Process irda_demo (pid: 814, stack limit = 0xc36ee1b8) [ 284.180000] Stack: (0xc36efdb8 to 0xc36f0000) [ 284.180000] fda0: c36efddc c36efdc8 [ 284.180000] fdc0: c0218ad8 c021cd84 c36c1c00 c365d6e0 c36efdec c36efde0 c0280cb8 c0218aa4 [ 284.180000] fde0: c36efe04 c36efdf0 c0206388 c0280ca0 c36c1c00 c36c1c00 c36efe2c c36efe08 [ 284.180000] fe00: c02066e4 c0206344 00000000 c36c1c00 c342ad20 c05a6008 00000000 c36ee000 [ 284.180000] fe20: c36efe44 c36efe30 c02077b0 c02066cc c36c1c00 00000000 c36efed4 c36efe48 [ 284.180000] fe40: c01ffe74 c0207790 c36efe84 00000000 c36c1ca8 00000000 00000120 00000001 [ 284.180000] fe60: 00000000 c36efee8 c36ee000 00000001 c37927bc 00000000 c36efe9c c36efe88 [ 284.180000] fe80: c008c878 c3723580 00000000 00000001 c342ad28 00000008 c0075400 00000000 [ 284.180000] fea0: 00000000 bce300d8 c34b41f0 c342ad20 c301f880 c34b4010 00000000 c3671e38 [ 284.180000] fec0: c3671e38 00000008 c36eff14 c36efed8 c00c7938 c01ffad8 00000000 00000000 [ 284.180000] fee0: c00e45bc c342ad28 c36eff0c 00000000 c34a35e0 00000000 c05f6188 c3792780 [ 284.180000] ff00: c37927bc 00000000 c36eff24 c36eff18 c00c7b60 c00c78b4 c36eff44 c36eff28 [ 284.180000] ff20: c003ae48 c00c7b60 c3792780 c34a35e0 00000000 c36ee000 c36eff7c c36eff48 [ 284.180000] ff40: c0021ecc c003adb0 00000000 00000000 00000003 00000000 00005402 be923984 [ 284.180000] ff60: c342ad20 c36ee000 c36effa4 000000f8 c36eff94 c36eff80 c00233c0 c0021c5c [ 284.180000] ff80: 00079698 00000000 c36effa4 c36eff98 c0023470 c002338c 00000000 c36effa8 [ 284.180000] ffa0: c000ef00 c0023468 00079698 00000000 00000001 00079684 be923984 00000001 [ 284.180000] ffc0: 00079698 00000000 00000000 000000f8 00000000 00000000 00000000 be9239cc [ 284.180000] ffe0: 00000000 be9239b8 0000820c 00015f24 00000010 00000001 00000000 00000000 [ 284.180000] Backtrace: [ 284.180000] [] (nuc970serial_stop_tx+0x0/0x74) from [] (uart_stop+0x44/0x68) [ 284.180000] [] (uart_stop+0x0/0x68) from [] (nuc970irda_close+0x28/0x2c) [ 284.180000] r5:c365d6e0 r4:c36c1c00 [ 284.180000] [] (nuc970irda_close+0x0/0x2c) from [] (tty_ldisc_close+0x54/0x6c) [ 284.180000] [] (tty_ldisc_close+0x0/0x6c) from [] (tty_ldisc_kill+0x28/0x138) [ 284.180000] r5:c36c1c00 r4:c36c1c00 [ 284.180000] [] (tty_ldisc_kill+0x0/0x138) from [] (tty_ldisc_release+0x30/0x50) [ 284.180000] r9:c36ee000 r8:00000000 r7:c05a6008 r6:c342ad20 r5:c36c1c00 r4:00000000 [ 284.180000] [] (tty_ldisc_release+0x0/0x50) from [] (tty_release+0x3ac/0x654) [ 284.180000] r5:00000000 r4:c36c1c00 [ 284.180000] [] (tty_release+0x0/0x654) from [] (fput+0x94/0x274) [ 284.180000] [] (fput+0x0/0x274) from [] (fput+0x10/0x14) [ 284.180000] [] (fput+0x0/0x14) from [] (task_work_run+0xa8/0xbc) [ 284.180000] [] (task_work_run+0x0/0xbc) from [] (do_exit+0x280/0x948) [ 284.180000] r7:c36ee000 r6:00000000 r5:c34a35e0 r4:c3792780 [ 284.180000] [] (do_exit+0x0/0x948) from [] (do_group_exit+0x44/0xdc) [ 284.180000] r7:000000f8 [ 284.180000] [] (do_group_exit+0x0/0xdc) from [] (SyS_exit_group+0x18/0x1c) [ 284.180000] r5:00000000 r4:00079698 [ 284.180000] [] (SyS_exit_group+0x0/0x1c) from [] (ret_fast_syscall+0x0/0x34) [ 284.180000] Code: 0a000002 e3c22002 e5903004 e5832004 (e5d1305c) [ 284.180000] ---[ end trace 42da37924208890b ]--- [ 284.180000] Fixing recursive fault but reboot is needed!

yachen commented 7 years ago

Did you configure kernel as below?

[*] Networking support ---> 
    <*> IrDA (infrared) subsystem support ---> 
     Infrared-port device drivers ---> 
             <*> NUC970 SIR on UART 
junwushi commented 7 years ago

yes,configure it already. and how to check nuc970-sir driver it working or not?

yachen commented 7 years ago

Hi,

Please pull commit f862b85 and test again.

Sincerely,

Yi-An Chen

junwushi commented 7 years ago

yes, when close irda it is not crash now. but are you test irda communication working or not . i still can't communicate with irda.

yachen commented 7 years ago

Yes we did and it works fine.

junwushi commented 7 years ago

but now is only send data succeeded and receive failed,and checked the wave signal is arrived to nuc972 uart5 RX pin but can't received one char

yachen commented 7 years ago

The IrDA SIR protocol is half-duplex only, was the TX active while RX receiving data?

junwushi commented 6 years ago

it is test only receving, no half-duplex problem,it still can not receive any char .but send char feature is fine,not found reason,and i am check RX of cpu wave ,it is very good. only uart5 not received any chars.

junwushi commented 6 years ago

can share the irda parts schematic?

yachen commented 6 years ago

capture

yachen commented 6 years ago

Hi @junwushi ,

Please let me know if you also need the OrCAD file.

Sincerely,

Yi-An Chen

junwushi commented 6 years ago

don't need or-cad file,I am use sensor is TFDU4101, it is different hsdl-3201?

yachen commented 6 years ago

We haven't used TFDU4101 before.

yachen commented 6 years ago

Close unless there's further discussion on this issue.