From owner-freebsd-current Tue Dec 17 5:40:41 2002 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 A582437B401; Tue, 17 Dec 2002 05:40:39 -0800 (PST) Received: from critter.freebsd.dk (critter.freebsd.dk [212.242.86.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id ACA4F43EDC; Tue, 17 Dec 2002 05:40:38 -0800 (PST) (envelope-from phk@critter.freebsd.dk) Received: from critter.freebsd.dk (localhost [127.0.0.1]) by critter.freebsd.dk (8.12.6/8.12.6) with ESMTP id gBHDeak5019315; Tue, 17 Dec 2002 14:40:36 +0100 (CET) (envelope-from phk@critter.freebsd.dk) To: Takahashi Yoshihiro Cc: sos@FreeBSD.ORG, current@FreeBSD.ORG Subject: Re: ata driver From: phk@FreeBSD.ORG In-Reply-To: Your message of "Tue, 17 Dec 2002 21:46:22 +0900." <20021217.214622.74695206.nyan@jp.FreeBSD.org> Date: Tue, 17 Dec 2002 14:40:36 +0100 Message-ID: <19314.1040132436@critter.freebsd.dk> Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I really wish somebody could tell us conclusively when to use the compat geometry and when not ? Is it only for ATA/IDE disks ? Does it depend on the size of the disks ? Does it also affect SCSI disks ? Poul-Henning In message <20021217.214622.74695206.nyan@jp.FreeBSD.org>, Takahashi Yoshihiro writes: >The current ata driver on pc98 has a problem. I think that the >following patch solves the problem. Please review it. This change >must be in RELENG_5_0 branch. > > >Index: sys/dev/ata/ata-disk.c >=================================================================== >RCS file: /home/ncvs/src/sys/dev/ata/ata-disk.c,v >retrieving revision 1.137 >diff -u -r1.137 ata-disk.c >--- sys/dev/ata/ata-disk.c 3 Dec 2002 20:19:37 -0000 1.137 >+++ sys/dev/ata/ata-disk.c 8 Dec 2002 08:50:01 -0000 >@@ -123,6 +123,14 @@ > adp->heads = atadev->param->heads; > adp->sectors = atadev->param->sectors; > adp->total_secs = atadev->param->cylinders * adp->heads * adp->sectors; >+#ifdef PC98 >+ if (adp->total_secs < 17 * 8 * 65536) { >+ /* convert PC98 geometry */ >+ adp->sectors = 17; >+ adp->heads = 8; >+ atadev->param->cylinders = adp->total_secs / (17 * 8); >+ } >+#endif > adp->max_iosize = 256 * DEV_BSIZE; > bioq_init(&adp->queue); > >Index: sys/geom/geom_pc98.c >=================================================================== >RCS file: /home/ncvs/src/sys/geom/geom_pc98.c,v >retrieving revision 1.20 >diff -u -r1.20 geom_pc98.c >--- sys/geom/geom_pc98.c 3 Dec 2002 20:18:35 -0000 1.20 >+++ sys/geom/geom_pc98.c 8 Dec 2002 04:47:43 -0000 >@@ -190,10 +190,6 @@ > sectorsize = cp->provider->sectorsize; > if (sectorsize < 512) > break; >- if (cp->provider->mediasize / sectorsize < 17 * 8 * 65536) { >- fwsectors = 17; >- fwheads = 8; >- } > gsp->frontstuff = sectorsize * fwsectors; > spercyl = (off_t)fwsectors * fwheads * sectorsize; > buf = g_read_data(cp, 0, > > >--- >TAKAHASHI Yoshihiro > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-current" in the body of the message > -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 phk@FreeBSD.ORG | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message