NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on earmv6hf NETWALKER



over 1 year passed..
Same error occured on my RPI2 with udl(GX-DVI_U2B).

> First thing to mention is that earmv7hf is the best MACHINE_ARCH for Cortex-A8

Using earmv7hf/earmv6hf/earm/arm kernel 7.99.42 RPI2.201611040530Z from
nyftp NetBSD-daily, produce same error at netbsd:udl_fill_rect+0xc.

I set up kgdb environment, and got:

Program received signal SIGINT, Interrupt.
udl_fill_line (width=<optimized out>, off=0, rgb16=<optimized out>, 
    sc=0xb8065008)
    at /.../src/sys/dev/usb/udl.c:1333
1333            udl_cmd_add_4(sc, ((off * 2) << 8) | (width & 0xff));
(gdb) bt
#0  udl_fill_line (width=<optimized out>, off=0, rgb16=<optimized out>, 
    sc=0xb8065008)
    at /.../src/sys/dev/usb/udl.c:1333
#1  udl_fill_rect (sc=sc@entry=0xb8065008, rgb16=<optimized out>, x=0, 
    y=<optimized out>, width=<optimized out>, height=480)
    at /.../src/sys/dev/usb/udl.c:1241
    :

And comment out some 'inline', nbmake-evbarm DEFCOPTS='-O0' udl.o, then:

Program received signal SIGINT, Interrupt.
0x800b7f68 in be32enc (dst=0xcb026002, u=0)
    at /.../src/sys/sys/endian.h:204
204     __GEN_ENDIAN_ENC(32, be)
(gdb) bt
#0  0x800b7f68 in be32enc (dst=0xcb026002, u=0)
    at /.../src/sys/sys/endian.h:204
#1  0x800b80c4 in udl_cmd_add_4 (sc=0xb68b1008, val=0)
    at /.../src/sys/dev/usb/udl.c:208
#2  0x800ba908 in udl_fill_line (sc=0xb68b1008, rgb16=0, off=0, width=256)
    at /.../src/sys/dev/usb/udl.c:1335
    :

(gdb) l
199             u = hto ## endian ## bits (u); \
200             __builtin_memcpy(dst, &u, sizeof(u)); \
201     }
202     
203     __GEN_ENDIAN_ENC(16, be)
204     __GEN_ENDIAN_ENC(32, be)
205     __GEN_ENDIAN_ENC(64, be)
206     __GEN_ENDIAN_ENC(16, le)
207     __GEN_ENDIAN_ENC(32, le)
208     __GEN_ENDIAN_ENC(64, le)


Replace be32enc(), be16enc() to use !(GCC >= 2.95) version, then the device
works good.
Something wrong with __builtin_memcpy()? or compiler optimization?

-mochid



Home | Main Index | Thread Index | Old Index