From owner-freebsd-current@FreeBSD.ORG Mon Aug 15 11:14:36 2005 Return-Path: X-Original-To: freebsd-current@FreeBSD.ORG Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id B4ED716A41F for ; Mon, 15 Aug 2005 11:14:36 +0000 (GMT) (envelope-from sos@FreeBSD.ORG) Received: from spider.deepcore.dk (cpe.atm2-0-53484.0x50a6c9a6.abnxx9.customer.tele.dk [80.166.201.166]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2840943D49 for ; Mon, 15 Aug 2005 11:14:35 +0000 (GMT) (envelope-from sos@FreeBSD.ORG) Received: from [194.192.25.136] (mac.deepcore.dk [194.192.25.136]) by spider.deepcore.dk (8.13.3/8.13.3) with ESMTP id j7FBDifE055294; Mon, 15 Aug 2005 13:13:44 +0200 (CEST) (envelope-from sos@FreeBSD.ORG) In-Reply-To: <200508142147.42045.Chris@LainOS.org> References: <200508132321.37654.Chris@LainOS.org> <200508142016.17769.Chris@LainOS.org> <200508142147.42045.Chris@LainOS.org> Mime-Version: 1.0 (Apple Message framework v733) Content-Type: multipart/mixed; boundary=Apple-Mail-4--231615995 Message-Id: <04450F5F-E3EB-4608-BE92-0C61CD0E3621@FreeBSD.ORG> From: =?ISO-8859-1?Q?S=F8ren_Schmidt?= Date: Mon, 15 Aug 2005 13:14:31 +0200 To: Chris@LainOS.org X-Mailer: Apple Mail (2.733) X-mail-scanned: by DeepCore Virus & Spam killer v1.12 Cc: freebsd-current@FreeBSD.ORG Subject: Re: Panic during install on Sparc64 - Only with large HDD X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 15 Aug 2005 11:14:36 -0000 --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--