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/31/2004 19:15:43
--DocE+STaALJfprDB
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Sun, Oct 31, 2004 at 06:46:25PM +0100, Michael Gerhards wrote:
> Okay. Then the patched wd.c file somehow causes that powerd doesn't
> start. Any ideas what might be responsible for this and how I could get
> powerd starting also with the patched wd.c?

My guess is that the system is so slow with the patched wd.c that it wasn't
started yet (I didn't think that wd_flushcache() was called at each partition
close, not only at shutdown time). But from the trace you posted, it looks
like the WDCC_FLUSHCACHE command isn't run, but at last we know that
wd_flushcache() is called.
With an unpatched kernel, you could try a dkctl wd0 synccache
and see what it returns.

You can also try the attached patch instead of the old one, to see if the
ata revision reported by your drive is the problem.

Yes, I checked that it compiles this time :)

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

--DocE+STaALJfprDB
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	31 Oct 2004 18:14:24 -0000
@@ -1663,9 +1663,9 @@
 wd_flushcache(struct wd_softc *wd, int flags)
 {
 	struct wdc_command wdc_c;
-
 	if (wd->drvp->ata_vers < 4) /* WDCC_FLUSHCACHE is here since ATA-4 */
-		return ENODEV;
+		printf("%s: ata_vers %d, trying flushcache anyway\n",
+		    wd->sc_dev.dv_xname, wd->drvp->ata_vers);
 	memset(&wdc_c, 0, sizeof(struct wdc_command));
 	if ((wd->sc_params.atap_cmd2_en & ATA_CMD2_LBA48) != 0 &&
 	    (wd->sc_params.atap_cmd2_en & ATA_CMD2_FCE) != 0)
@@ -1700,6 +1700,7 @@
 		    wd->sc_dev.dv_xname);
 		return EIO;
 	}
+	printf("flush cache command completed\n");
 	return 0;
 }
 

--DocE+STaALJfprDB--