Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jan 2004 19:10:01 +0100 (CET)
From:      sos@deepcore.dk
To:        Randy Bush <randy@psg.com>
Cc:        Jeffrey Katcher <jmkatcher@yahoo.com>
Subject:   Re: 5.2-CURRENT panic on startup after cvsup: probably recent ATA
Message-ID:  <200401131810.i0DIA1ul008001@spider.deepcore.dk>
In-Reply-To: <E1AgSTh-0004DM-U5@ran.psg.com>

next in thread | previous in thread | raw e-mail | index | archive | help
It seems Randy Bush wrote:
> >> ata1: reiniting channel ..
> >> ata1: reset tp1 mask=03 ostat0=00 ostat1=00
> >> ata1-master: stat=0x00 err=0x01 lsb=0x14 msb=0xeb
> >> ata1-slave: stat=0x00 err=0x01 lsb=0x14 msb=0xeb
> >> ata1: reset tp2 mask=03 stat0=00 stat1=00 devices=0xc<ATAPI_SLAVE,ATAPI_MASTER>
> >> ata1: resetting done ..
> >> ata1-master: pio=0x0c wdma=0x22 udma=0x42 cable=40pin
> >> ata1-master: setting PIO4 on Intel ICH4 chip
> >> ata1-master: setting PIO4 on Intel ICH4 chip
> >> ata1: device config done ..
> >> 
> >> Fatal trap 12: page fault while in kernel mode
> >> 
> >> Is that any help?
> > 
> > And what do youhave on ata1 ? one ATAPI device as master ?
> 
> in my case, there is nothing on ata1.  well, at least no devices ...

Well  I need you boot log (verbose) as well then, since the aboveis
because of a fake device that ruins lunch...

Anyhow I came up with this fix that might help:

Index: ata-all.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-all.c,v
retrieving revision 1.199
diff -u -r1.199 ata-all.c
--- ata-all.c	11 Jan 2004 22:08:34 -0000	1.199
+++ ata-all.c	13 Jan 2004 18:05:20 -0000
@@ -569,7 +569,7 @@
 	    request->retries = 3;
 	    request->bytecount = sizeof(struct ata_params);
 	    request->transfersize = DEV_BSIZE;
-	    while (request->retries) {
+	    while (request->retries > 0 ) {
 		ata_queue_request(request);
 		if (!(error = request->result))
 		    break;
@@ -577,14 +577,8 @@
 	    }
 	    ata_free_request(request);
 	}
-	if (!isprint(atadev->param->model[0]) ||
-	    !isprint(atadev->param->model[1]))
-	    error = ENXIO;
-	if (error) {
-	    free(atadev->param, M_ATA);
-	    atadev->param = NULL;
-	}
-	else {
+	if (!error && (isprint(atadev->param->model[0]) ||
+		       isprint(atadev->param->model[1]))) {
 	    struct ata_params *atacap = atadev->param;
 #if BYTE_ORDER == BIG_ENDIAN
 	    int16_t *ptr;
@@ -612,6 +606,14 @@
 			   ata_pmode(atacap), ata_wmode(atacap),
 			   ata_umode(atacap),
 			   (atacap->hwres & ATA_CABLE_ID) ? "80":"40");
+	}
+	else {
+	    if (!error)
+		error = ENXIO;
+	    if (atadev->param) {
+		free(atadev->param, M_ATA);
+		atadev->param = NULL;
+	    }
 	}
     }
     return error;
-Søren
                     Yes I know it works under windows!!



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