Subject: port-evbmips/36248: ADM5120 kernel trap when writing to serial device.
To: None <port-evbmips-maintainer@netbsd.org, gnats-admin@netbsd.org,>
From: None <si1356@yahoo.co.uk>
List: netbsd-bugs
Date: 04/29/2007 20:55:00
>Number:         36248
>Category:       port-evbmips
>Synopsis:       ADM5120 kernel trap when writing to serial device.
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    port-evbmips-maintainer
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Apr 29 20:55:00 +0000 2007
>Originator:     Simon H.
>Release:        Current
>Organization:
>Environment:
No uname on target board.
>Description:

I didn't know the minor device number for the second serial port
on the adm5120 (it has two) so I created a number of different device nodes to try them out:  uart0, uart1, uart2, uart3 etc... all with major number 77, and increasing minor numbers from zero.

I tried to send some text to each of the devices in turn using echo.
The first two devices both echoed back to the console (which was on the
serial port).  This in itself may be a bug, but when I tried to echo to the third device (with minor number 2), this caused: 

trap: TLB miss (load or instr. fetch) in kernel mode
status=0xf003, cause=0x30000008, epc=0x801215e4, vaddr=0x3c
pid=25 cmd=sh usp=0x7fffda80 ksp=0xc2f75c98
Stopped in pid 25.1 (sh) at     netbsd:uart_open+0x40:  lw      s0,60(v0)

I was expecting to see 'device not configured', or something like that.

>How-To-Repeat:
Create device nodes:

mknod /dev/uart0 c 77 0
mknod /dev/uart1 c 77 1
mknod /dev/uart2 c 77 2
mknod /dev/uart3 c 77 3

echo "hello" > /dev/uart2


>Fix: