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