Subject: Re: [2.0-RC1] shutdown is not clean
To: Michael Gerhards <HM-Gerhards@uni.de>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: port-sparc64
Date: 10/10/2004 16:17:26
--UlVJffcvxoiEqYs2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sun, Oct 10, 2004 at 03:21:30PM +0200, Michael Gerhards wrote:
> 
> Well - but why didn't this also appear on NetBSD 1.6.2? Are there any
> changes in this behaviour between 1.6.2 and 2.0?

One think that would help is to check that the flushcache command is
really still executed.
Please try the attached patch, it should show some verbose information
about what's going on at shutdown time.

-- 
Manuel Bouyer <bouyer@antioche.eu.org>
     NetBSD: 26 ans d'experience feront toujours la difference
--

--UlVJffcvxoiEqYs2
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: wd.c
===================================================================
RCS file: /cvsroot/src/sys/dev/ata/wd.c,v
retrieving revision 1.274.2.8
diff -u -r1.274.2.8 wd.c
--- wd.c	1 Oct 2004 03:48:30 -0000	1.274.2.8
+++ wd.c	10 Oct 2004 14:16:37 -0000
@@ -1663,6 +1663,9 @@
 wd_flushcache(struct wd_softc *wd, int flags)
 {
 	struct wdc_command wdc_c;
+extern int wdcdebug_mask;
+
+	wdcdebug_mask=0xff
 
 	if (wd->drvp->ata_vers < 4) /* WDCC_FLUSHCACHE is here since ATA-4 */
 		return ENODEV;
@@ -1676,6 +1679,7 @@
 	wdc_c.r_st_pmask = WDCS_DRDY;
 	wdc_c.flags = flags;
 	wdc_c.timeout = 30000; /* 30s timeout */
+	printf("doing flush cache command 0x%x\n", wdc_c.r_command);
 	if (wd->atabus->ata_exec_command(wd->drvp, &wdc_c) != WDC_COMPLETE) {
 		printf("%s: flush cache command didn't complete\n",
 		    wd->sc_dev.dv_xname);
@@ -1700,6 +1704,7 @@
 		    wd->sc_dev.dv_xname);
 		return EIO;
 	}
+	printf("flush cache command completed\n", wdc_c.r_command);
 	return 0;
 }
 

--UlVJffcvxoiEqYs2--