Subject: Re: wdc_amiga (Re: CVS commit: src/sys/dev)
To: Jukka Andberg <jandberg@NetBSD.org>
From: Aymeric Vincent <vincent@labri.fr>
List: current-users
Date: 08/22/2004 19:39:39
--Apple-Mail-2-1072545798
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=ISO-8859-1;
	format=flowed



Le 22 ao=FBt 04, =E0 17:13, Jukka Andberg a =E9crit :

>> wdc_init_shadow_regs() must now be called after ch_wdc is filled in,=20=

>> or we get a null pointer dereference.
>
> I think we need something similar to wdc_amiga to stop it from=20
> crashing. Attached patch fixes it for me, can anyone with a clue see=20=

> if it's ok to commit?

Your patch looks fine to me; and a similar fix for the macppc makes wdc=20=

work again on my laptop. Thanks!

Feel free to commit; I'll commit the macppc part tomorrow if no one=20
does it before.

  Aymeric


--Apple-Mail-2-1072545798
Content-Transfer-Encoding: 7bit
Content-Type: application/octet-stream;
	x-unix-mode=0644;
	name="diff-wdc_obio"
Content-Disposition: attachment;
	filename=diff-wdc_obio

Index: wdc_obio.c
===================================================================
RCS file: /usr/local/cvsroot-netbsd/src/sys/arch/macppc/dev/wdc_obio.c,v
retrieving revision 1.40
diff -u -u -r1.40 wdc_obio.c
--- wdc_obio.c	20 Aug 2004 06:39:38 -0000	1.40
+++ wdc_obio.c	22 Aug 2004 16:20:58 -0000
@@ -176,7 +176,6 @@
 			return;
 		}
 	}
-	wdc_init_shadow_regs(chp);
 #if 0
 	wdr->data32iot = wdr->cmd_iot;
 	wdr->data32ioh = wdr->cmd_ioh;
@@ -222,6 +221,8 @@
 	chp->ch_atac = &sc->sc_wdcdev.sc_atac;
 	chp->ch_queue = &sc->sc_chqueue;
 
+	wdc_init_shadow_regs(chp);
+
 #define OHARE_FEATURE_REG	0xf3000038
 
 	/* XXX Enable wdc1 by feature reg. */

--Apple-Mail-2-1072545798--