Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 21 Apr 2004 11:09:27 +0100
From:      Gavin Atkinson <gavin.atkinson@ury.york.ac.uk>
To:        Elliot Finley <lists@efinley.com>
Cc:        freebsd-current@freebsd.org
Subject:   Re: ASUS P4P800 doesn't reboot
Message-ID:  <1082542166.36802.59.camel@buffy.york.ac.uk>
In-Reply-To: <03b201c42735$413af7b0$32cba1cd@science1>
References:  <03b201c42735$413af7b0$32cba1cd@science1>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Wed, 2004-04-21 at 01:11, Elliot Finley wrote:
> I have several systems using the ASUS P4P800 MB.  When I issue a 'reboot',
> they shut down cleanly.  They then stop after the 'uptime' line and hang.
> 
> If I remember correctly, this started happening between 5.2-R and 5.2.1-R.
> 
> I have a test box that I can take down at any time.  I just need some
> guidance on how to troubleshoot this.

Is this a SCSI based machine? I'm trying to solve this same problem on a
machine I have with an Adaptec 7899 SCSI card and a Mylex 352 raid card
- and have found mine to be hanging while shutting down the SCSI
subsystem. How long have you left it to reboot before giving up waiting?
Can you apply the attached patch and see what messages are given on
shutdown? Also, it is possible that this patch will change things for
you - there are two things that the SCSI shutdown routine can hang on
that will now time out after a few minutes with the patch. Patch is
against top-of-tree -CURRENT. It's worth applying even if you don'y use
SCSI because it adds a few printf's to other places too.

Gavin

[-- Attachment #2 --]
--- sys/kern/kern_shutdown.c.old	Mon Apr  5 22:03:35 2004
+++ sys/kern/kern_shutdown.c	Thu Apr  8 18:31:25 2004
@@ -187,7 +187,7 @@
 {
 
 	shutdown_howto = howto;
-
+	printf("shutdown_nice called\n");
 	/* Send a signal to init(8) and have it shutdown the world */
 	if (initproc != NULL) {
 		PROC_LOCK(initproc);
@@ -363,14 +363,19 @@
 	 * Ok, now do things that assume all filesystem activity has
 	 * been completed.
 	 */
+	printf("About to shutdown_post_sync\n");
 	EVENTHANDLER_INVOKE(shutdown_post_sync, howto);
+	printf("shutdown_post_sync returned\n");
+	DELAY(1000000);	/* wait 1 sec for printf's to complete and be read */
 	splhigh();
 	if ((howto & (RB_HALT|RB_DUMP)) == RB_DUMP &&
 	    !cold && dumper.dumper != NULL && !dumping) 
 		doadump();
 
 	/* Now that we're going to really halt the system... */
+	printf("About to shutdown_final\n");
 	EVENTHANDLER_INVOKE(shutdown_final, howto);
+	printf("shutdown_final returned\n");
 
 	for(;;) ;	/* safety against shutdown_reset not working */
 	/* NOTREACHED */
--- sys/cam/scsi/scsi_da.c.old	Mon Apr 19 14:38:10 2004
+++ sys/cam/scsi/scsi_da.c	Wed Apr 21 10:37:11 2004
@@ -1747,10 +1747,12 @@
 	struct cam_periph *periph;
 	struct da_softc *softc;
 
+	printf(" - dashutdown started... ");
 	TAILQ_FOREACH(periph, &dadriver.units, unit_links) {
 		union ccb ccb;
 		softc = (struct da_softc *)periph->softc;
 
+		printf("\n - - pass 1 ");
 		/*
 		 * We only sync the cache if the drive is still open, and
 		 * if the drive is capable of it..
@@ -1758,10 +1760,11 @@
 		if (((softc->flags & DA_FLAG_OPEN) == 0)
 		 || (softc->quirks & DA_Q_NO_SYNC_CACHE))
 			continue;
-
+		printf("setup...");
 		xpt_setup_ccb(&ccb.ccb_h, periph->path, /*priority*/1);
 
 		ccb.ccb_h.ccb_state = DA_CCB_DUMP;
+        	printf("sync_cache...");
 		scsi_synchronize_cache(&ccb.csio,
 				       /*retries*/1,
 				       /*cbfcnp*/dadone,
@@ -1769,15 +1772,18 @@
 				       /*begin_lba*/0, /* whole disk */
 				       /*lb_count*/0,
 				       SSD_FULL_SIZE,
-				       60 * 60 * 1000);
+				       5 * 60 * 1000);
+ 	       printf("polled_action...");
 
 		xpt_polled_action(&ccb);
+        	printf("returned. ");
 
 		if ((ccb.ccb_h.status & CAM_STATUS_MASK) != CAM_REQ_CMP) {
 			if (((ccb.ccb_h.status & CAM_STATUS_MASK) ==
 			     CAM_SCSI_STATUS_ERROR)
 			 && (ccb.csio.scsi_status == SCSI_STATUS_CHECK_COND)){
 				int error_code, sense_key, asc, ascq;
+        			printf("error extract...");
 
 				scsi_extract_sense(&ccb.csio.sense_data,
 						   &error_code, &sense_key,
@@ -1793,14 +1799,20 @@
 			}
 		}
 
-		if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0)
+		if ((ccb.ccb_h.status & CAM_DEV_QFRZN) != 0) {
+                	printf("release_devq...");
 			cam_release_devq(ccb.ccb_h.path,
 					 /*relsim_flags*/0,
 					 /*reduction*/0,
-					 /*timeout*/0,
+					 /*timeout*/120 * 1000,
 					 /*getcount_only*/0);
+			printf("returned.");
+		} else {
+			printf("no release_devq...");
+		}
 
 	}
+	printf("\n - dashutdown finished\n");
 }
 
 #else /* !_KERNEL */
--- sys/dev/ata/ata-all.c.old	Tue Apr 13 10:44:20 2004
+++ sys/dev/ata/ata-all.c	Wed Apr 21 10:59:34 2004
@@ -343,6 +343,7 @@
     struct ata_channel *ch;
     int ctlr;
 
+    printf(" - ata_shutdown started... ");
     /* flush cache on all devices */
     for (ctlr = 0; ctlr < devclass_get_maxunit(ata_devclass); ctlr++) {
 	if (!(ch = devclass_get_softc(ata_devclass, ctlr)))
@@ -354,6 +355,7 @@
 	    ch->device[SLAVE].param->support.command2 & ATA_SUPPORT_FLUSHCACHE)
 	    ata_controlcmd(&ch->device[SLAVE], ATA_FLUSHCACHE, 0, 0, 0);
     }
+    printf("finished.\n");
 }
 
 /*
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1082542166.36802.59.camel>