Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Aug 2005 13:14:31 +0200
From:      =?ISO-8859-1?Q?S=F8ren_Schmidt?= <sos@FreeBSD.ORG>
To:        Chris@LainOS.org
Cc:        freebsd-current@FreeBSD.ORG
Subject:   Re: Panic during install on Sparc64 - Only with large HDD
Message-ID:  <04450F5F-E3EB-4608-BE92-0C61CD0E3621@FreeBSD.ORG>
In-Reply-To: <200508142147.42045.Chris@LainOS.org>
References:  <200508132321.37654.Chris@LainOS.org> <200508142016.17769.Chris@LainOS.org> <DDA34AD5-6279-4E7F-B40E-2537389591CE@FreeBSD.org> <200508142147.42045.Chris@LainOS.org>

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

--Apple-Mail-4--231615995
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=ISO-8859-1;
	delsp=yes;
	format=flowed


On 14/08/2005, at 21:47, Chris Gilbert wrote:

> Hi S=F8ren,
>
> Thanks a bunch for your reply!
>
> Yea, I thought it may have been a 137GB limitation, I wasn't =20
> positive though.
>
> Thanks for clearing it up.

Please try the attached patch and let me know how it goes.
It reduces disk size so 48BIT mode is not engaged at all.
However one could just use PIO above the 48BIT cutoff, but I'm not =20
certain that works always either so better on the safe side.

Anyhow,you are not supposed to use modern disks on that HW anyways :)


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

Index: ata-all.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-all.c,v
retrieving revision 1.253
diff -u -r1.253 ata-all.c
--- ata-all.c	12 Aug 2005 16:54:11 -0000	1.253
+++ ata-all.c	15 Aug 2005 11:05:22 -0000
@@ -608,6 +608,10 @@
 		   ata_mode2str(ata_umode(atacap)),
 		   (atacap->hwres & ATA_CABLE_ID) ? "80":"40");
 
+	/* if controller doesn't support 48 bit access we disable it here */
+	if (ch->flags & ATA_NO_48BIT_ACCESS)
+	    atadev->param.support.command2 &= ~ATA_SUPPORT_ADDRESS48;
+
 	if (atadev->param.config & ATA_PROTO_ATAPI) {
 	    if (atapi_dma && ch->dma &&
 		(atadev->param.config & ATA_DRQ_MASK) != ATA_DRQ_INTR &&
Index: ata-all.h
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-all.h,v
retrieving revision 1.104
diff -u -r1.104 ata-all.h
--- ata-all.h	29 Jul 2005 18:14:06 -0000	1.104
+++ ata-all.h	15 Aug 2005 11:02:39 -0000
@@ -493,6 +493,7 @@
 #define         ATA_NO_SLAVE            0x01
 #define         ATA_USE_16BIT           0x02
 #define         ATA_ATAPI_DMA_RO        0x04
+#define         ATA_NO_48BIT_ACCESS     0x08
 
     int                         devices;        /* what is present */
 #define         ATA_ATA_MASTER          0x01
Index: ata-chipset.c
===================================================================
RCS file: /home/ncvs/src/sys/dev/ata/ata-chipset.c,v
retrieving revision 1.128
diff -u -r1.128 ata-chipset.c
--- ata-chipset.c	12 Aug 2005 16:54:11 -0000	1.128
+++ ata-chipset.c	15 Aug 2005 11:07:07 -0000
@@ -74,6 +74,7 @@
 static void ata_acard_86X_setmode(device_t dev, int mode);
 static int ata_ali_chipinit(device_t dev);
 static int ata_ali_allocate(device_t dev);
+static int ata_ali_sata_allocate(device_t dev);
 static void ata_ali_setmode(device_t dev, int mode);
 static int ata_amd_chipinit(device_t dev);
 static int ata_cyrix_chipinit(device_t dev);
@@ -870,7 +871,7 @@
 	pci_write_config(dev, PCIR_COMMAND,
 			 pci_read_config(dev, PCIR_COMMAND, 2) & ~0x0400, 2);
 	ctlr->channels = ctlr->chip->cfg1;
-	ctlr->allocate = ata_ali_allocate;
+	ctlr->allocate = ata_ali_sata_allocate;
 	ctlr->setmode = ata_sata_setmode;
 	break;
 
@@ -881,6 +882,8 @@
 
 	/* enable cable detection and UDMA support on newer chips */
 	pci_write_config(dev, 0x4b, pci_read_config(dev, 0x4b, 1) | 0x09, 1);
+
+	ctlr->allocate = ata_ali_allocate;
 	ctlr->setmode = ata_ali_setmode;
 	break;
 
@@ -897,6 +900,24 @@
 static int
 ata_ali_allocate(device_t dev)
 {
+    struct ata_pci_controller *ctlr = device_get_softc(device_get_parent(dev));
+    struct ata_channel *ch = device_get_softc(dev);
+
+    /* setup the usual register normal pci style */
+    ata_pci_allocate(dev);
+
+    /* only chips with revision > 0xc4 can do 48bit DMA */
+    if (ctlr->chip->chiprev <= 0xc4) {
+	device_printf(dev, "WARNING controller does not support 48BIT access, "
+			   "limitting usable disk sizes to safe values\n");
+	ch->flags |= ATA_NO_48BIT_ACCESS;
+    }
+    return 0;
+}
+
+static int
+ata_ali_sata_allocate(device_t dev)
+{
     device_t parent = device_get_parent(dev);
     struct ata_pci_controller *ctlr = device_get_softc(parent);
     struct ata_channel *ch = device_get_softc(dev);

--Apple-Mail-4--231615995
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain;
	charset=ISO-8859-1;
	format=flowed


- S=F8ren




--Apple-Mail-4--231615995--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?04450F5F-E3EB-4608-BE92-0C61CD0E3621>