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



The following reply was made to PR kern/50038; it has been noted by GNATS.

From: MOCHIDA Shuji <mochid%netside.co.jp@localhost>
To: martin%duskware.de@localhost
Cc: skrll%netbsd.org@localhost, gnats-bugs%NetBSD.org@localhost, kern-bug-people%netbsd.org@localhost,
 gnats-admin%netbsd.org@localhost, netbsd-bugs%netbsd.org@localhost, mochid%netside.co.jp@localhost
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
 



Home | Main Index | Thread Index | Old Index