NetBSD Problem Report #50038

From mochid@coco.yorie.netside.co.jp  Tue Jul  7 16:29:33 2015
Return-Path: <mochid@coco.yorie.netside.co.jp>
Received: from mail.netbsd.org (mail.netbsd.org [149.20.53.66])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 75F2FA5B2E
	for <gnats-bugs@gnats.NetBSD.org>; Tue,  7 Jul 2015 16:29:33 +0000 (UTC)
Message-Id: <20150707143333.D5DE52B452@coco.yorie.netside.co.jp>
Date: Tue,  7 Jul 2015 23:33:33 +0900 (JST)
From: mochid@netside.co.jp
Reply-To: mochid@netside.co.jp
To: gnats-bugs@gnats.NetBSD.org
Subject: udl (DisplayLink GX-DVI_U2B) alignment fault on earmv6hf NETWALKER
X-Send-Pr-Version: 3.95

>Number:         50038
>Category:       kern
>Synopsis:       udl (DisplayLink GX-DVI_U2B) alignment fault on earmv6hf NETWALKER
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    kern-bug-people
>State:          feedback
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Jul 07 16:30:00 +0000 2015
>Closed-Date:    
>Last-Modified:  Wed Mar 04 21:25:55 +0000 2020
>Originator:     MOCHIDA Shuji
>Release:        NetBSD 7.99.19 update at 2015 July 5
>Organization:
NETside
>Environment:
evbarm earmv6hf NETWALKER Cortex-A8
>Description:
    no serial console, so type by hand (may with some typos..)

udl0 at uhub2 port 1
udl0: DisplayLink GX-DVI_U2B, rev 2.00/1.06, addr 3
Fatal kernel mode data abort:'Alignment Fault 1'
trapframe: 0x9fdc7b30
FSR=00000001, FAR=ca6c0002, spsr=800d0013
r0 =00000000, r1 =00000000, r2 =00000000, r3 =ca6c0002
r4 =9b64d000, r5 =00000000, r6 =00000000, r7 =000069af
r8 =0000fff5, r9 =00000100, r10=0004b000, r11=9fdc7bcc
r12=00000000, ssp=9fdc7b00, slr=003bf22f, pc =003bdbd0

Stopped inpid 0.36 (system) at netbsd:udl_fill_rect+0xc0:    str    r0, [r3]

db> bt
0x9fdc7bcc: netbsd:udl_fill_rect+0xc
0x9fdc7da4: netbsd:udl_attach+0xdac
0x9fdc7dd4: netbsd:config_attach_loc+0x1a4
0x9fdc7e4c: netbsd:usbd_attachwholedevice+0xb4
0x9fdc7e7c: netbsd:usbd_probe_and_attach+0x24
0x9fdc7ecc: netbsd:usbd_new_device+0x2d0
0x9fdc7f1c: netbsd:uhub_explore+0x2d0
0x9fdc7f6c: netbsd:uhub_explore+0x88
0x9fdc7f8c: netbsd:usb_discover.isra.0+0x54
0x9fdc7fac: netbsd:usb_event_thread+0x88
db> 

>How-To-Repeat:
	plug Buffalo GX-DVI/U2B to NETWALKER's USB port.
>Fix:
	please.

>Release-Note:

>Audit-Trail:
From: Nick Hudson <skrll@netbsd.org>
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org, 
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Cc: 
Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on earmv6hf
 NETWALKER
Date: Wed, 08 Jul 2015 16:29:35 +0100

 On 07/07/15 17:30, mochid@netside.co.jp wrote:
 >> Number:         50038
 >> Category:       kern
 >> Synopsis:       udl (DisplayLink GX-DVI_U2B) alignment fault on earmv6hf NETWALKER

 >> Environment:
 > evbarm earmv6hf NETWALKER Cortex-A8


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

 earm allows unaligned accesses, but, for some reason, your netwalker 
 isn't allowing this.

 Full verbose (boot -v) dmesg and VERBOSE_INIT_ARM output from a kernel 
 from today will help.

 Thanks,
 Nick



From: MOCHIDA Shuji <mochid@netside.co.jp>
To: skrll@netbsd.org
Cc: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on
 earmv6hf NETWALKER
Date: Thu, 10 Nov 2016 23:46:41 +0900 (JST)

 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

From: Martin Husemann <martin@duskware.de>
To: MOCHIDA Shuji <mochid@netside.co.jp>
Cc: skrll@netbsd.org, gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
	gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on earmv6hf NETWALKER
Date: Thu, 10 Nov 2016 18:54:57 +0100

 On Thu, Nov 10, 2016 at 11:46:41PM +0900, MOCHIDA Shuji wrote:
 > Replace be32enc(), be16enc() to use !(GCC >= 2.95) version, then the device
 > works good.
 > Something wrong with __builtin_memcpy()? or compiler optimization?

 I don't see what is wrong with the source - sc->sc_cmd_buf is a uint8_t*
 passed directly as void* to the inline function, no bogus casts involved,
 so the compiler can not assume proper alignment.

 Maybe I am missing something, or it is a compiler bug.

 Martin

From: MOCHIDA Shuji <mochid@netside.co.jp>
To: martin@duskware.de
Cc: skrll@netbsd.org, gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, mochid@netside.co.jp
Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on
 earmv6hf NETWALKER
Date: Tue, 15 Nov 2016 03:31:56 +0900 (JST)

 Easy workaround below. May something related to alignment.
 In these functions, (curcpu()->ci_ctrl & CPU_CONTROL_AFLT_ENABLE) is zero.
 This should not be zero?

 skrll> Full verbose (boot -v) dmesg and VERBOSE_INIT_ARM output from a kernel 
 skrll> from today will help.

 Should I put that here?


 --- udl.c.ORIG	2016-10-19 05:17:37.000000000 +0900
 +++ udl.c	2016-11-15 02:59:21.000000000 +0900
 @@ -187,8 +187,14 @@
  static inline void
  udl_cmd_add_2(struct udl_softc *sc, uint16_t val)
  {
 +	uint8_t *p = sc->sc_cmd_buf;

 -	be16enc(sc->sc_cmd_buf, val);
 +	if (ALIGNED_POINTER(p, uint16_t))
 +		be16enc(p, val);
 +	else {
 +		*p++ = (val >> 8) & 0xff;
 +		*p = val & 0xff;
 +	}
  	sc->sc_cmd_buf += 2;
  }

 @@ -203,8 +209,16 @@
  static inline void
  udl_cmd_add_4(struct udl_softc *sc, uint32_t val)
  {
 +	uint8_t *p = sc->sc_cmd_buf;

 -	be32enc(sc->sc_cmd_buf, val);
 +	if (ALIGNED_POINTER(p, uint32_t))
 +		be32enc(p, val);
 +	else {
 +		*p++ = (val >> 24) & 0xff;
 +		*p++ = (val >> 16) & 0xff;
 +		*p++ = (val >> 8) & 0xff;
 +		*p = val & 0xff;
 +	}
  	sc->sc_cmd_buf += 4;
  }


 -mochid

From: Nick Hudson <skrll@netbsd.org>
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, mochid@netside.co.jp
Cc: 
Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on
 earmv6hf NETWALKER
Date: Tue, 15 Nov 2016 08:37:39 +0000

 On 11/14/16 20:30, MOCHIDA Shuji wrote:
 > The following reply was made to PR kern/50038; it has been noted by GNATS.
 >
 > From: MOCHIDA Shuji <mochid@netside.co.jp>
 > To: martin@duskware.de
 > Cc: skrll@netbsd.org, gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 >   gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, mochid@netside.co.jp
 > Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on
 >   earmv6hf NETWALKER
 > Date: Tue, 15 Nov 2016 03:31:56 +0900 (JST)
 >
 >   Easy workaround below. May something related to alignment.
 >   In these functions, (curcpu()->ci_ctrl & CPU_CONTROL_AFLT_ENABLE) is zero.
 >   This should not be zero?
 >   
 >   skrll> Full verbose (boot -v) dmesg and VERBOSE_INIT_ARM output from a kernel
 >   skrll> from today will help.
 >   
 >   Should I put that here?

 yes, please.

 Nick

From: Nick Hudson <skrll@netbsd.org>
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, mochid@netside.co.jp
Cc: 
Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on
 earmv6hf NETWALKER
Date: Tue, 15 Nov 2016 10:33:11 +0000

 On 11/14/16 20:30, MOCHIDA Shuji wrote:
 > The following reply was made to PR kern/50038; it has been noted by GNATS.
 >
 > From: MOCHIDA Shuji <mochid@netside.co.jp>
 > To: martin@duskware.de
 > Cc: skrll@netbsd.org, gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 >   gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, mochid@netside.co.jp
 > Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on
 >   earmv6hf NETWALKER
 > Date: Tue, 15 Nov 2016 03:31:56 +0900 (JST)
 >
 >   Easy workaround below. May something related to alignment.
 >   In these functions, (curcpu()->ci_ctrl & CPU_CONTROL_AFLT_ENABLE) is zero.
 >   This should not be zero?
 >   

 We should be running with SCTLR.A =0 and SCTLR.U = 1, i.e.
 CPU_CONTROL_AFLT_ENABLE unset and CPU_CONTROL_UNAL_ENABLE set, but
 I think the usb transfer buffer is being marked as device/strongly 
 ordered memory and
 we get an unaligned access fault because of this.

 Nick

From: MOCHIDA Shuji <mochid@netside.co.jp>
To: skrll@netbsd.org
Cc: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on
 earmv6hf NETWALKER
Date: Wed, 16 Nov 2016 22:18:45 +0900 (JST)

 >>> Full verbose (boot -v) dmesg and VERBOSE_INIT_ARM output from a kernel

 >>     Should I put that here?

 > yes, please.


 @DFG01H1IJKLMZMP<>

 NetBSD/evbarm (rpi) booting ...
 rpi_bootparams: firmware rev 54f5d408
 rpi_bootparams: mac-address  280d59******
 rpi_bootparams: board model  0
 rpi_bootparams: board rev    a01041
 rpi_bootparams: board serial 9d******
 rpi_bootparams: DMA channel mask 0x00007f35
 rpi_bootparams: cmdline      dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1080 bcm2709.boardrev=0xa01041 bcm2709.serial=0x9d590d28 smsc95xx.macaddr=B8:27:EB:59:0D:28 bcm2708_fb.fbswap=1 bcm2709.disk_led_gpio=47 bcm2709.disk_led_active_low=0 sdhci-bcm2708.emmc_clock_freq=250000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  root=ld0a -v
 rpi_bootstrap: 4 cpus present
 rpi_bootstrap: cortex_mmuinfo 7ffc05b
 @@@FFFGGG000111HHH111IIIJJJKKKLLLMMMinitarm: arm clock   600000000
 initarm: Configuring system ...
 arm32_bootmem_init: memstart=0, memsize=0x3b000000, kernelstart=0x8000
 arm32_bootmem_init: kernelend=0x98a000
 arm32_bootmem_init: adding 119611 free pages: [0x98a000..0x3affffff] (VA 0x8098a000)
 arm32_bootmem_init: adding 4 free pages: [0..0x7fff] (VA 0x80000000)
 arm32_kernel_vm_init: 2 L2 pages are needed to map 0x9da000 kernel bytes
 arm32_kernel_vm_init: allocating page tables for kerneladd_pages: adding pv 0x806969e8 (pa 0x98a000, va 0x8098a000, 1 pages) at tail
 add_pages: appending pv 0x80697e50 (0x98c000..0x98ffff) to 0x98a000..0x98bfff
 add_pages: appending pv 0x80696ba8 (0x990000..0x991fff) to 0x98a000..0x98ffff
  vmadd_pages: appending pv 0x80696bbc (0x992000..0x993fff) to 0x98a000..0x991fff
 add_pages: appending pv 0x80696bd0 (0x994000..0x995fff) to 0x98a000..0x993fff
 add_pages: appending pv 0x80696be4 (0x996000..0x997fff) to 0x98a000..0x995fff
 add_pages: appending pv 0x80696bf8 (0x998000..0x999fff) to 0x98a000..0x997fff
 add_pages: appending pv 0x80696c0c (0x99a000..0x99bfff) to 0x98a000..0x999fff
 add_pages: appending pv 0x80696c20 (0x99c000..0x99dfff) to 0x98a000..0x99bfff
 add_pages: appending pv 0x80696c34 (0x99e000..0x99ffff) to 0x98a000..0x99dfff
 add_pages: appending pv 0x80696c48 (0x9a0000..0x9a1fff) to 0x98a000..0x99ffff
 arm32_kernel_vm_init: allocating stacks
 add_pages: appending pv 0x80697598 (0x9a2000..0x9a9fff) to 0x98a000..0x9a1fff
 add_pages: appending pv 0x80697584 (0x9aa000..0x9b1fff) to 0x98a000..0x9a9fff
 add_pages: appending pv 0x80697570 (0x9b2000..0x9b9fff) to 0x98a000..0x9b1fff
 add_pages: appending pv 0x8069755c (0x9ba000..0x9c1fff) to 0x98a000..0x9b9fff
 add_pages: appending pv 0x80697544 (0x9c2000..0x9c9fff) to 0x98a000..0x9c1fff
 add_pages: appending pv 0x806975ac (0x9ca000..0x9cbfff) to 0x98a000..0x9c9fff
 add_pages: appending pv 0x80696a28 (0x9cc000..0x9cffff) to 0x98a000..0x9cbfff
 Creating L1 page table at 0x0098c000
 arm32_kernel_vm_init: adding L2 pt (VA 0x8098a000, PA 0x98a000) for VA 0x80000000 (kernel)
 arm32_kernel_vm_init: adding L2 pt (VA 0x80990000, PA 0x990000) for VA 0x80800000 (kernel)
 arm32_kernel_vm_init: adding L2 pt (VA 0x80992000, PA 0x992000) for VA 0xc0000000 (vm)
 arm32_kernel_vm_init: adding L2 pt (VA 0x80994000, PA 0x994000) for VA 0xc0800000 (vm)
 arm32_kernel_vm_init: adding L2 pt (VA 0x80996000, PA 0x996000) for VA 0xc1000000 (vm)
 arm32_kernel_vm_init: adding L2 pt (VA 0x80998000, PA 0x998000) for VA 0xc1800000 (vm)
 arm32_kernel_vm_init: adding L2 pt (VA 0x8099a000, PA 0x99a000) for VA 0xc2000000 (vm)
 arm32_kernel_vm_init: adding L2 pt (VA 0x8099c000, PA 0x99c000) for VA 0xc2800000 (vm)
 arm32_kernel_vm_init: adding L2 pt (VA 0x8099e000, PA 0x99e000) for VA 0xc3000000 (vm)
 arm32_kernel_vm_init: adding L2 pt (VA 0x809a0000, PA 0x9a0000) for VA 0xc3800000 (vm)
 Mapping kernel
 arm32_kernel_vm_init: adding chunk for kernel text 0x8000..0x4f7fff (VA 0x80008000)
 add_pages: adding pv 0x806969d4 (pa 0x8000, va 0x80008000, 632 pages) before pa 0x98a000
 arm32_kernel_vm_init: adding chunk for kernel data/bss 0x4f8000..0x989fff (VA 0x804f8000)
 add_pages: adding pv 0x806969c0 (pa 0x4f8000, va 0x804f8000, 585 pages) before pa 0x98a000
 Listing Chunks
 arm32_kernel_vm_init: pv 0x806969d4: chunk VA 0x80008000..0x804f7fff (PA 0x8000, prot 7, cache 1)
 arm32_kernel_vm_init: pv 0x806969c0: chunk VA 0x804f8000..0x80989fff (PA 0x4f8000, prot 3, cache 1)
 arm32_kernel_vm_init: pv 0x806969e8: chunk VA 0x8098a000..0x809cffff (PA 0x98a000, prot 3, cache 1)

 Mapping Chunks
 arm32_kernel_vm_init: mapping chunk VA 0x80000000..0x80007fff (PA 0, prot 3, cache 1)
 pmap_map_chunk: pa=0x0 va=0x80000000 size=0x8000 resid=0x8000 prot=0x3 cache=1
 PPPP
 arm32_kernel_vm_init: mapping chunk VA 0x80008000..0x804f7fff (PA 0x8000, prot 7, cache 1)
 pmap_map_chunk: pa=0x8000 va=0x80008000 size=0x4f0000 resid=0x4f0000 prot=0x7 cache=1
 PPPPLLLLLLLLLLLLLLLSSSLLLLLLLLLLLLLLLPPPP
 arm32_kernel_vm_init: mapping last chunk VA 0x804f8000..0xbaffffff (PA 0x4f8000, prot 3, cache 1)
 pmap_map_chunk: pa=0x4f8000 va=0x804f8000 size=0x3ab08000 resid=0x3ab08000 prot=0x3 cache=1
 PPPPSSSSSSSSSSSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsSsS
 devmap: 3f000000 -> 3fffffff @ f3000000
 pmap_map_chunk: pa=0x3f000000 va=0xf3000000 size=0x1000000 resid=0x1000000 prot=0x3 cache=0
 sS
 devmap: 40000000 -> 400fffff @ f4000000
 pmap_map_chunk: pa=0x40000000 va=0xf4000000 size=0x100000 resid=0x100000 prot=0x3 cache=0
 S
                              Physical              Virtual        Num
                        Starting    Ending    Starting    Ending   Pages
                SDRAM: 0x00000000 0x3affffff 0x80000000 0xbaffffff 120832
         text section: 0x00008000 0x004f7fff 0x80008000 0x804f7fff 632
         data section: 0x00590000 0x006962d8 0x80590000 0x806962d8 132
          bss section: 0x006962d8 0x00989de8 0x806962d8 0x80989de8 378
    L1 page directory: 0x0098c000 0x0098ffff 0x8098c000 0x8098ffff 2
    ABT stack (CPU 0): 0x009a2000 0x009a3fff 0x809a2000 0x809a3fff 1
    FIQ stack (CPU 0): 0x009aa000 0x009abfff 0x809aa000 0x809abfff 1
    IRQ stack (CPU 0): 0x009b2000 0x009b3fff 0x809b2000 0x809b3fff 1
    UND stack (CPU 0): 0x009ba000 0x009bbfff 0x809ba000 0x809bbfff 1
   IDLE stack (CPU 0): 0x009c2000 0x009c3fff 0x809c2000 0x809c3fff 1
            SVC stack: 0x009ca000 0x009cbfff 0x809ca000 0x809cbfff 1
       Message Buffer: 0x009cc000 0x009cffff 0x809cc000 0x809cffff 2
          Free Memory: 0x009d0000 0x3affffff                       119576
          Free Memory: 0x00000000 0x00007fff                       4
 TTBR0=0x7ffc05b TTBR1=0x7ffc05b TTBCR=0x1 CONTEXTIDR=0
 switching to new L1 page table @0x98c000... ttb (TTBCR=0x11 TTBR0=0x98c05b TTBR1=0x98c05b) hatchlingscpu_boot_secondary_processors: writing mbox with 0xe
  OK
 done.
 nfreeblocks = 2, free_pages = 119580 (0x1d31c)
 bootstrap done.
 vectors vbar=0x8001f2c0 0x8001f2c0
 init subsystems: stacks vectors undefined page pmap_physload pmap kpm tlb0 kcpusets locks l1pt cache(l1pt) specials pools [ Kernel symbol table missing! ]
 done.
 Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
     2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016
     The NetBSD Foundation, Inc.  All rights reserved.
 Copyright (c) 1982, 1986, 1989, 1991, 1993
     The Regents of the University of California.  All rights reserved.

 NetBSD 7.99.39 (EBONY1) #0: Fri Oct 21 04:37:15 JST 2016
         mochid@alder:/vol1/shed/alder/mochid/obj-kern/evbarm-RPI-1.68/EBONY1
 total memory = 944 MB
 avail memory = 924 MB
 sysctl_createv: sysctl_create(machine_arch) returned 17
 timecounter: Timecounters tick every 10.000 msec
 crypto: assign driver 0, flags 2
 crypto: driver 0 registers alg 1 flags 0 maxoplen 0
 crypto: driver 0 registers alg 2 flags 0 maxoplen 0
 crypto: driver 0 registers alg 3 flags 0 maxoplen 0
 crypto: driver 0 registers alg 4 flags 0 maxoplen 0
 crypto: driver 0 registers alg 5 flags 0 maxoplen 0
 crypto: driver 0 registers alg 26 flags 0 maxoplen 0
 crypto: driver 0 registers alg 27 flags 0 maxoplen 0
 crypto: driver 0 registers alg 29 flags 0 maxoplen 0
 crypto: driver 0 registers alg 33 flags 0 maxoplen 0
 crypto: driver 0 registers alg 17 flags 0 maxoplen 0
 crypto: driver 0 registers alg 6 flags 0 maxoplen 0
 crypto: driver 0 registers alg 19 flags 0 maxoplen 0
 crypto: driver 0 registers alg 7 flags 0 maxoplen 0
 crypto: driver 0 registers alg 20 flags 0 maxoplen 0
 crypto: driver 0 registers alg 15 flags 0 maxoplen 0
 crypto: driver 0 registers alg 24 flags 0 maxoplen 0
 crypto: driver 0 registers alg 25 flags 0 maxoplen 0
 crypto: driver 0 registers alg 8 flags 0 maxoplen 0
 crypto: driver 0 registers alg 21 flags 0 maxoplen 0
 crypto: driver 0 registers alg 16 flags 0 maxoplen 0
 crypto: driver 0 registers alg 9 flags 0 maxoplen 0
 crypto: driver 0 registers alg 10 flags 0 maxoplen 0
 crypto: driver 0 registers alg 13 flags 0 maxoplen 0
 crypto: driver 0 registers alg 14 flags 0 maxoplen 0
 crypto: driver 0 registers alg 28 flags 0 maxoplen 0
 crypto: driver 0 registers alg 30 flags 0 maxoplen 0
 crypto: driver 0 registers alg 31 flags 0 maxoplen 0
 crypto: driver 0 registers alg 32 flags 0 maxoplen 0
 crypto: driver 0 registers alg 11 flags 0 maxoplen 0
 crypto: driver 0 registers alg 18 flags 0 maxoplen 0
 crypto: driver 0 registers alg 23 flags 0 maxoplen 0
 crypto: driver 0 registers alg 22 flags 0 maxoplen 0
 mainbus0 (root)
 cpu0 at mainbus0 core 0: 600 MHz Cortex-A7 r0p5 (Cortex V7A core)
 cpu0: DC enabled IC enabled WB disabled EABT branch prediction enabled
 cpu0: 32KB/32B 2-way L1 VIPT Instruction cache
 cpu0: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
 cpu0: 512KB/64B 8-way write-through L2 PIPT Unified cache
 vfp0 at cpu0: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals
 cpu1 at mainbus0 core 1
 cpu2 at mainbus0 core 2
 cpu3 at mainbus0 core 3
 obio0 at mainbus0
 bcmicu0 at obio0: Multiprocessor
 armgtmr0 at obio0: ARMv7 Generic 64-bit Timer (19200 kHz)
 armgtmr0: interrupting on irq 3
 timecounter: Timecounter "armgtmr0" frequency 19200000 Hz quality 500
 bcmmbox0 at obio0 intr 193: VC mailbox
 vcmbox0 at bcmmbox0
 vchiq0 at obio0 intr 194: BCM2835 VCHIQ
 bcmpm0 at obio0: Power management, Reset and Watchdog controller
 bcmdmac0 at obio0: DMA0 DMA2 DMA4 DMA5 DMA8 DMA9 DMA10
 bcmrng0 at obio0: RNG
 plcom0 at obio0 intr 185
 plcom0: txfifo disabled
 plcom0: console
 genfb0 at obio0no data for est. mode 640x480x67
 Vendor: [MEL] Mitsubishi Elec
 Product: [47BA] MDT221WTF
 Serial number: 01010101
 Manufactured 2008 Week 44
 EDID Version 1.3
 EDID Comment: 
 Video Input: 80
         Digital
 Gamma: 2.20
 Max Size: 48 cm x 27 cm
 Features: ea
         DPMS standby
         DPMS suspend
         DPMS active-off
         RGB
         Preferred timing
 Chroma Info:
         Red X: 0.648
         Red Y: 0.648
         Grn X: 0.282
         Grn Y: 0.602
         Blu X: 0.142
         Blu Y: 0.070
         Wht X: 0.313
         Wht Y: 0.329
 Range:
         Horizontal: 31 - 83 kHz
         Vertical: 49 - 76 Hz
         Max Dot Clock: 150 MHz
 Video modes:
         720x400 @ 70Hz (28320 738 846 900 412 414 449 -H +V)
         640x480 @ 60Hz (25175 656 752 800 490 492 525 -H -V)
         640x480 @ 73Hz (31500 664 704 832 489 492 520 -H -V)
         640x480 @ 75Hz (31500 656 720 840 481 484 500 -H -V)
         800x600 @ 60Hz (40000 840 968 1056 601 605 628 +H +V)
         800x600 @ 72Hz (50000 856 976 1040 637 643 666 +H +V)
         800x600 @ 75Hz (49500 816 896 1056 601 604 625 +H +V)
         832x624 @ 75Hz (57284 864 928 1152 625 628 667 -H -V)
         1024x768 @ 60Hz (65000 1048 1184 1344 771 777 806 -H -V)
         1024x768 @ 70Hz (75000 1048 1184 1328 771 777 806 -H -V)
         1024x768 @ 75Hz (78750 1040 1136 1312 769 772 800 +H +V)
         1280x1024 @ 75Hz (135000 1296 1440 1688 1025 1028 1066 +H +V)
         1152x864 @ 75Hz (108000 1216 1344 1600 865 868 900 +H +V)
         1280x1024 @ 60Hz (108000 1328 1440 1688 1025 1028 1066 +H +V)
         1280x960 @ 60Hz (108000 1376 1488 1800 961 964 1000 +H +V)
         1440x900 @ 60Hz (106470 1520 1672 1904 901 904 932 +H +V)
         1680x1050 @ 60Hz (146250 1784 1960 2240 1053 1059 1089 -H +V)
         1920x1080 @ 60Hz (148500 2008 2052 2200 1084 1089 1125 +H +V)
 Preferred mode: 1920x1080 @ 60Hz
 Number of extension blocks: 1
 rpi_fb_init: addr = 0x3d402000 size = 8355840
 rpi_fb_init: depth = 32
 rpi_fb_init: pitch = 7680
 rpi_fb_init: width = 1920 height = 1080
 rpi_fb_init: vwidth = 1920 vheight = 1080

 genfb0: framebuffer at 0x3d402000, size 1920x1080, depth 32, stride 7680
 wsdisplay0 at genfb0 kbdmux 1
 wsmux1: connecting to wsdisplay0
 wsdisplay0: screen 0-3 added (default, vt100 emulation)
 sdhc0 at obio0 intr 190: SDHC controller
 sdhc0: interrupting on intr 190
 dwctwo0 at obio0 intr 137: USB controller
 bcmspi0 at obio0 intr 182: SPI
 spi0 at bcmspi0: SPI bus
 bsciic0 at obio0 intr 181: BSC0
 iic0 at bsciic0: I2C bus
 bsciic1 at obio0 intr 181: BSC1
 iic1 at bsciic1: I2C bus
 bcmgpio0 at obio0: GPIO [0...31]
 gpio0 at bcmgpio0: 32 pins
 bcmgpio1 at obio0: GPIO [32...53]
 gpio1 at bcmgpio1: 22 pins
 bcmcm at obio0 not configured
 bcmpwm at obio0 not configured
 usb0 at dwctwo0: USB revision 2.0
 timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
 cpu_boot_secondary_processors: writing mbox with 0xe
 cpu_hatch(cpu3):  vectorscpu_hatch(cpu1):  vbar=0x8001f2c0cpu_hatch(cpu2):  vectors stacks vbar=0x8001f2c0 stacks tlb vectorscpu3 vbar=0x8001f2c0 stacks tlb tlb: 600 MHz Cortex-A7 r0p5 (Cortex V7A core)
 cpu3: DC enabled IC enabled WB disabled EABT branch prediction enabled
 cpu3: 32KB/32B 2-way L1 VIPT Instruction cache
 cpu3: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
 cpu3: 512KB/64B 8-way write-through L2 PIPT Unified cache
  vfpvfp3 at cpu3: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals
  interruptscpu2 md(0x800108d8): 600 MHz Cortex-A7 r0p5 (Cortex V7A core)
 cpu2: done!
  DC enabled IC enabled WB disabled EABT branch prediction enabled
 cpu2: 32KB/32B 2-way L1 VIPT Instruction cache
 cpu2: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
 cpu2: 512KB/64B 8-way write-through L2 PIPT Unified cache
  vfpvfp2 at cpu2: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals
  interruptscpu1 md(0x800108d8): 600 MHz Cortex-A7 r0p5 (Cortex V7A core)
  done!
 cpu1: DC enabled IC enabled WB disabled EABT branch prediction enabled
 cpu1: 32KB/32B 2-way L1 VIPT Instruction cache
 cpu1: 32KB/64B 4-way write-back-locking-C L1 PIPT Data cache
 cpu1: 512KB/64B 8-way write-through L2 PIPT Unified cache
  vfpvfp1 at cpu1: NEON MPE (VFP 3.0+), rounding, NaN propagation, denormals
  interrupts md(0x800108d8) done!
 sdhc0: SDHC 3.0, rev 153, platform DMA, 250000 kHz, HS SDR50 3.3V, re-tuning mode 1, 1024 byte blocks
 sdmmc0 at sdhc0 slot 0
 uhub0 at usb0: vendor 0000 DWC2 root hub, class 9/0, rev 2.00/1.00, addr 1
 uhub0: 1 port with 1 removable, self powered
 ld0 at sdmmc0: <0x74:0x4a45:USDU1:0x10:0x4589faee:0x0eb>
 ld0: 15079 MB, 7659 cyl, 64 head, 63 sec, 512 bytes/sect x 30881792 sectors
 IPsec: Initialized Security Association Processing.
 ld0: 4-bit width, SDR50, 100.000 MHz
 uhub1 at uhub0 port 1: vendor 0424 product 9514, class 9/0, rev 2.00/2.00, addr 2
 uhub1: multiple transaction translators
 uhub1: 5 ports with 4 removable, self powered
 usmsc0 at uhub1 port 1
 usmsc0: vendor 0424 product ec00, rev 2.00/2.00, addr 3
 usmsc0: Ethernet address b8:27:eb:59:0d:28
 ukphy0 at usmsc0 phy 1: OUI 0x00800f, model 0x000c, rev. 3
 ukphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
 uhub0: illegal enable change, port 1
 crypto: assign driver 1, flags 2
 crypto: driver 1 registers alg 1 flags 0 maxoplen 0
 crypto: driver 1 registers alg 2 flags 0 maxoplen 0
 crypto: driver 1 registers alg 3 flags 0 maxoplen 0
 crypto: driver 1 registers alg 4 flags 0 maxoplen 0
 crypto: driver 1 registers alg 5 flags 0 maxoplen 0
 crypto: driver 1 registers alg 26 flags 0 maxoplen 0
 crypto: driver 1 registers alg 27 flags 0 maxoplen 0
 crypto: driver 1 registers alg 29 flags 0 maxoplen 0
 crypto: driver 1 registers alg 33 flags 0 maxoplen 0
 crypto: driver 1 registers alg 17 flags 0 maxoplen 0
 crypto: driver 1 registers alg 6 flags 0 maxoplen 0
 crypto: driver 1 registers alg 19 flags 0 maxoplen 0
 crypto: driver 1 registers alg 7 flags 0 maxoplen 0
 crypto: driver 1 registers alg 20 flags 0 maxoplen 0
 crypto: driver 1 registers alg 15 flags 0 maxoplen 0
 crypto: driver 1 registers alg 24 flags 0 maxoplen 0
 crypto: driver 1 registers alg 25 flags 0 maxoplen 0
 crypto: driver 1 registers alg 8 flags 0 maxoplen 0
 crypto: driver 1 registers alg 21 flags 0 maxoplen 0
 crypto: driver 1 registers alg 16 flags 0 maxoplen 0
 crypto: driver 1 registers alg 9 flags 0 maxoplen 0
 crypto: driver 1 registers alg 10 flags 0 maxoplen 0
 crypto: driver 1 registers alg 13 flags 0 maxoplen 0
 crypto: driver 1 registers alg 14 flags 0 maxoplen 0
 crypto: driver 1 registers alg 28 flags 0 maxoplen 0
 crypto: driver 1 registers alg 30 flags 0 maxoplen 0
 crypto: driver 1 registers alg 31 flags 0 maxoplen 0
 crypto: driver 1 registers alg 32 flags 0 maxoplen 0
 crypto: driver 1 registers alg 11 flags 0 maxoplen 0
 crypto: driver 1 registers alg 18 flags 0 maxoplen 0
 crypto: driver 1 registers alg 23 flags 0 maxoplen 0
 crypto: driver 1 registers alg 22 flags 0 maxoplen 0
 WARNING: 1 error while detecting hardware; check system log.
 boot device: ld0

 -mochid

From: MOCHIDA Shuji <mochid@netside.co.jp>
To: skrll@netbsd.org
Cc: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on
 earmv6hf NETWALKER
Date: Wed, 16 Nov 2016 22:32:34 +0900 (JST)

 >>   In these functions, (curcpu()->ci_ctrl & CPU_CONTROL_AFLT_ENABLE) is zero.

 > We should be running with SCTLR.A =0 and SCTLR.U = 1, i.e.
 > CPU_CONTROL_AFLT_ENABLE unset and CPU_CONTROL_UNAL_ENABLE set, but
 > I think the usb transfer buffer is being marked as device/strongly ordered memory and
 > we get an unaligned access fault because of this.

 be32enc(sc->sc_cmd_buf, val) -- sc_cmd_buf is allocated in
 usbdi.c:414 usbd_alloc_buffer() using kmem_alloc()..

 -mochid

From: Nick Hudson <skrll@netbsd.org>
To: MOCHIDA Shuji <mochid@netside.co.jp>
Cc: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on
 earmv6hf NETWALKER
Date: Wed, 16 Nov 2016 14:25:59 +0000

 This is a multi-part message in MIME format.
 --------------070209080704090605080902
 Content-Type: text/plain; charset=utf-8; format=flowed
 Content-Transfer-Encoding: 7bit

 On 11/16/16 13:32, MOCHIDA Shuji wrote:
 >>>    In these functions, (curcpu()->ci_ctrl & CPU_CONTROL_AFLT_ENABLE) is zero.
 >> We should be running with SCTLR.A =0 and SCTLR.U = 1, i.e.
 >> CPU_CONTROL_AFLT_ENABLE unset and CPU_CONTROL_UNAL_ENABLE set, but
 >> I think the usb transfer buffer is being marked as device/strongly ordered memory and
 >> we get an unaligned access fault because of this.
 > be32enc(sc->sc_cmd_buf, val) -- sc_cmd_buf is allocated in
 > usbdi.c:414 usbd_alloc_buffer() using kmem_alloc()..

 nearly... usbd_alloc_buller() using  usb_allocmem_flags()

 https://nxr.netbsd.org/xref/src/sys/dev/usb/usbdi.c#403

 You could try removing BUS_DMA_COHERENT from the bus_dmamem_map call - 
 see diff.

 > -mochid
 >
 >

 Nick

 --------------070209080704090605080902
 Content-Type: text/plain; charset=UTF-8;
  name="diff"
 Content-Transfer-Encoding: base64
 Content-Disposition: attachment;
  filename="diff"

 SW5kZXg6IHN5cy9kZXYvdXNiL3VzYl9tZW0uYwo9PT09PT09PT09PT09PT09PT09PT09PT09
 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09ClJDUyBmaWxlOiAv
 Y3Zzcm9vdC9zcmMvc3lzL2Rldi91c2IvdXNiX21lbS5jLHYKcmV0cmlldmluZyByZXZpc2lv
 biAxLjY4CmRpZmYgLXUgLXAgLXIxLjY4IHVzYl9tZW0uYwotLS0gc3lzL2Rldi91c2IvdXNi
 X21lbS5jCTMwIEFwciAyMDE2IDE0OjMxOjM5IC0wMDAwCTEuNjgKKysrIHN5cy9kZXYvdXNi
 L3VzYl9tZW0uYwkxNiBOb3YgMjAxNiAxNDoyNDo1MCAtMDAwMApAQCAtMTY4LDcgKzE2OCw3
 IEBAIHVzYl9ibG9ja19hbGxvY21lbShidXNfZG1hX3RhZ190IHRhZywgc2kKIAkJZ290byBm
 cmVlMDsKIAogCWVycm9yID0gYnVzX2RtYW1lbV9tYXAodGFnLCBiLT5zZWdzLCBiLT5uc2Vn
 cywgYi0+c2l6ZSwKLQkJCSAgICAgICAmYi0+a2FkZHIsIEJVU19ETUFfV0FJVE9LfEJVU19E
 TUFfQ09IRVJFTlQpOworCQkJICAgICAgICZiLT5rYWRkciwgQlVTX0RNQV9XQUlUT0spOwog
 CWlmIChlcnJvcikKIAkJZ290byBmcmVlMTsKIAoK
 --------------070209080704090605080902--

From: MOCHIDA Shuji <mochid@netside.co.jp>
To: skrll@netbsd.org
Cc: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on
 earmv6hf NETWALKER
Date: Fri, 18 Nov 2016 03:08:11 +0900 (JST)

 > You could try removing BUS_DMA_COHERENT from the bus_dmamem_map call - see diff.

 That change seems to cause USB errors. USB ports are unusable.


   :
 uhub0 at usb0: vendor 0000 DWC2 root hub, class 9/0, rev 2.00/1.00, addr 1
 uhub0: 1 port with 1 removable, self powered
   :
 usbd_new_device: addr=2 bad max packet size=0. adjusting to 64.
 uhub0: device problem, disabling port 1
 usbd_new_device: addr=2 bad max packet size=0. adjusting to 64.
 uhub0: device problem, disabling port 1
 uhub0: port error, restarting port 1
 usbd_new_device: addr=2 bad max packet size=0. adjusting to 64.
 uhub0: device problem, disabling port 1
 uhub0: port error, restarting port 1
 usbd_new_device: addr=2 bad max packet size=0. adjusting to 64.
 uhub0: device problem, disabling port 1
 uhub0: port error, restarting port 1
 usbd_new_device: addr=2 bad max packet size=0. adjusting to 64.
 uhub0: device problem, disabling port 1
 uhub0: port error, restarting port 1
 usbd_new_device: addr=2 bad max packet size=0. adjusting to 64.
 uhub0: device problem, disabling port 1
 uhub0: port error, restarting port 1
 uhub0: port error, giving up port 1
   :


 -mochid

From: Nick Hudson <skrll@netbsd.org>
To: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, mochid@netside.co.jp
Cc: 
Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on
 earmv6hf NETWALKER
Date: Sun, 4 Dec 2016 17:01:05 +0000

 On 11/17/16 18:05, MOCHIDA Shuji wrote:
 > The following reply was made to PR kern/50038; it has been noted by GNATS.
 >
 > From: MOCHIDA Shuji <mochid@netside.co.jp>
 > To: skrll@netbsd.org
 > Cc: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 >   gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
 > Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on
 >   earmv6hf NETWALKER
 > Date: Fri, 18 Nov 2016 03:08:11 +0900 (JST)
 >
 >   > You could try removing BUS_DMA_COHERENT from the bus_dmamem_map call - see diff.
 >   
 >   That change seems to cause USB errors. USB ports are unusable.

 Can you cvs update to get src/sys/external/bsd/dwc2/dwc2.c:1.45 and try 
 again?

 Thanks,
 Nick

From: MOCHIDA Shuji <mochid@netside.co.jp>
To: skrll@netbsd.org
Cc: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on
 earmv6hf NETWALKER
Date: Tue, 06 Dec 2016 02:02:37 +0900 (JST)

 > Can you cvs update to get src/sys/external/bsd/dwc2/dwc2.c:1.45 and try again?

 With that, I see no error any more. My udl0 works good.
 Thank you very much.

 -mochid

From: Nick Hudson <skrll@netbsd.org>
To: MOCHIDA Shuji <mochid@netside.co.jp>, martin@duskware.de
Cc: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
 gnats-admin@netbsd.org, netbsd-bugs@netbsd.org
Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on
 earmv6hf NETWALKER
Date: Tue, 6 Dec 2016 07:33:42 +0000

 On 11/14/16 18:31, MOCHIDA Shuji wrote:
 >

 Now it's been shown that device/strongly ordered memory is the reason I 
 think we should commit your diff...


 > --- udl.c.ORIG	2016-10-19 05:17:37.000000000 +0900
 > +++ udl.c	2016-11-15 02:59:21.000000000 +0900
 > @@ -187,8 +187,14 @@
 >   static inline void
 >   udl_cmd_add_2(struct udl_softc *sc, uint16_t val)
 >   {
 > +	uint8_t *p = sc->sc_cmd_buf;
 >   
 > -	be16enc(sc->sc_cmd_buf, val);
 > +	if (ALIGNED_POINTER(p, uint16_t))
 > +		be16enc(p, val);
 > +	else {
 > +		*p++ = (val >> 8) & 0xff;
 > +		*p = val & 0xff;
 > +	}
 >   	sc->sc_cmd_buf += 2;
 >   }
 >   
 > @@ -203,8 +209,16 @@
 >   static inline void
 >   udl_cmd_add_4(struct udl_softc *sc, uint32_t val)
 >   {
 > +	uint8_t *p = sc->sc_cmd_buf;
 >   
 > -	be32enc(sc->sc_cmd_buf, val);
 > +	if (ALIGNED_POINTER(p, uint32_t))
 > +		be32enc(p, val);
 > +	else {
 > +		*p++ = (val >> 24) & 0xff;
 > +		*p++ = (val >> 16) & 0xff;
 > +		*p++ = (val >> 8) & 0xff;
 > +		*p = val & 0xff;
 > +	}
 >   	sc->sc_cmd_buf += 4;
 >   }
 >   
 >
 > -mochid
 >
 >
 Nick

From: matthew green <mrg@eterna.com.au>
To: Nick Hudson <skrll@netbsd.org>
Cc: gnats-bugs@NetBSD.org, kern-bug-people@netbsd.org,
    gnats-admin@netbsd.org, netbsd-bugs@netbsd.org,
    MOCHIDA Shuji <mochid@netside.co.jp>, martin@duskware.de
Subject: re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on earmv6hf NETWALKER
Date: Tue, 06 Dec 2016 19:07:44 +1100

 > Now it's been shown that device/strongly ordered memory is the reason I 
 > think we should commit your diff...
 > 
 > > --- udl.c.ORIG	2016-10-19 05:17:37.000000000 +0900
 > > +++ udl.c	2016-11-15 02:59:21.000000000 +0900
 > > @@ -187,8 +187,14 @@
 > >   static inline void
 > >   udl_cmd_add_2(struct udl_softc *sc, uint16_t val)
 > >   {
 > > +	uint8_t *p = sc->sc_cmd_buf;
 > >   
 > > -	be16enc(sc->sc_cmd_buf, val);
 > > +	if (ALIGNED_POINTER(p, uint16_t))
 > > +		be16enc(p, val);
 > > +	else {
 > > +		*p++ = (val >> 8) & 0xff;
 > > +		*p = val & 0xff;
 > > +	}

 doesn't the else{} block assume little endianness?


 .mrg.

From: Martin Husemann <martin@duskware.de>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/50038: udl (DisplayLink GX-DVI_U2B) alignment fault on earmv6hf NETWALKER
Date: Tue, 6 Dec 2016 11:12:42 +0100

 On Tue, Dec 06, 2016 at 07:45:01AM +0000, Nick Hudson wrote:
 >  Now it's been shown that device/strongly ordered memory is the reason I 
 >  think we should commit your diff...

 I am still not convinced that the udl driver is the right place to fix this,
 but you know more about arm MMUs and USB, so pick the convenient target...

 Martin

State-Changed-From-To: open->feedback
State-Changed-By: skrll@NetBSD.org
State-Changed-When: Wed, 04 Mar 2020 21:25:55 +0000
State-Changed-Why:
Should be fixed in netbsd-9 (not 9.0 release unfortunately) and HEAD


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.