From owner-freebsd-current Sun Nov 3 22:37: 5 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 D9B3137B401; Sun, 3 Nov 2002 22:37:02 -0800 (PST) Received: from zibbi.icomtek.csir.co.za (zibbi.icomtek.csir.co.za [146.64.24.58]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6D59F43E6E; Sun, 3 Nov 2002 22:37:00 -0800 (PST) (envelope-from jhay@zibbi.icomtek.csir.co.za) Received: from zibbi.icomtek.csir.co.za (localhost [IPv6:::1]) by zibbi.icomtek.csir.co.za (8.12.6/8.12.6) with ESMTP id gA46aYD8089789; Mon, 4 Nov 2002 08:36:34 +0200 (SAT) (envelope-from jhay@zibbi.icomtek.csir.co.za) Received: (from jhay@localhost) by zibbi.icomtek.csir.co.za (8.12.6/8.12.6/Submit) id gA46aYDA089784; Mon, 4 Nov 2002 08:36:34 +0200 (SAT) (envelope-from jhay) From: John Hay Message-Id: <200211040636.gA46aYDA089784@zibbi.icomtek.csir.co.za> Subject: umass CF geometry problems, was Re: fdisk -BI ob clean disk broken In-Reply-To: <20021102.122842.35978977.imp@bsdimp.com> from "M. Warner Losh" at "Nov 2, 2002 12:28:42 pm" To: imp@bsdimp.com (M. Warner Losh) Date: Mon, 4 Nov 2002 08:36:34 +0200 (SAT) Cc: current@FreeBSD.ORG, n_hibma@FreeBSD.ORG X-Mailer: ELM [version 2.4ME+ PL54 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit 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 > : Hmmm. I just noticed that the disks probe with zero values for the > : heads, sectors/track and cylinders. I have tried two different USB > : CF readers and both do it. On 4.x it probes with the correct values > : on the same machine and the same devices. So why do they probe > : wrong? > > Don't know. I've had problems with CF readers returning the wrong > geometry values in 4.3, but never 0's Ok, I found it. It is part of the rev 1.61 change to umass.c. It was made in June. :-/ The relevant piece is this: ########### Index: umass.c =================================================================== RCS file: /home/ncvs/src/sys/dev/usb/umass.c,v retrieving revision 1.60 retrieving revision 1.61 diff -u -r1.60 -r1.61 --- umass.c 11 Apr 2002 21:09:41 -0000 1.60 +++ umass.c 16 Jun 2002 20:53:35 -0000 1.61 ... @@ -2445,35 +2441,16 @@ } case XPT_CALC_GEOMETRY: { +#ifdef UMASS_DEBUG struct ccb_calc_geometry *ccg = &ccb->ccg; - +#endif DPRINTF(UDMASS_SCSI, ("%s:%d:%d:%d:XPT_CALC_GEOMETRY: " - "Volume size = %d\n", + "Volume size = %d (unimplemented)\n", USBDEVNAME(sc->sc_dev), cam_sim_path(umass_sim), ccb->ccb_h.target_id, ccb->ccb_h.target_lun, ccg->volume_size)); - /* XXX We should probably ask the drive for the details - * instead of cluching them up ourselves - */ - if (sc->drive == ZIP_100) { - ccg->heads = 64; - ccg->secs_per_track = 32; - ccg->cylinders = ccg->volume_size / ccg->heads - / ccg->secs_per_track; - ccb->ccb_h.status = CAM_REQ_CMP; - break; - } else if (sc->proto & PROTO_UFI) { - ccg->heads = 2; - if (ccg->volume_size == 2880) - ccg->secs_per_track = 18; - else - ccg->secs_per_track = 9; - ccg->cylinders = 80; - break; - } else { - ccb->ccb_h.status = CAM_REQ_CMP_ERR; - } + ccb->ccb_h.status = CAM_REQ_CMP_ERR; xpt_done(ccb); break; .. ########### If I understand this correctly, it means it just faked the geometry, which explains Warner's comment that it didn't get the geometry always right. So the question now is do we just leave umass like this, which means we can't do low level disk stuff on umass devices, or do we add something like this back or is there another way? Is there a way to get the real geometry of the device? John -- John Hay -- John.Hay@icomtek.csir.co.za / jhay@FreeBSD.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message