From owner-freebsd-firewire@FreeBSD.ORG Sun Dec 26 20:37:45 2004 Return-Path: Delivered-To: freebsd-firewire@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C282116A4CE; Sun, 26 Dec 2004 20:37:45 +0000 (GMT) Received: from dastardly.newsbastards.org.72.27.172.IN-addr.ARPA.NOSPAM.dyndns.dk (84-72-30-72.dclient.hispeed.ch [84.72.30.72]) by mx1.FreeBSD.org (Postfix) with ESMTP id BAAB043D1D; Sun, 26 Dec 2004 20:37:43 +0000 (GMT) (envelope-from bounce@NOSPAM.dyndns.dk) Received: from Mail.NOSPAM.DynDNS.dK (ipv6.NOSPAM.dyndns.dk [2002:5448:1e48:0:210:60ff:fe25:f1e5]) (8.11.6/8.11.6-SPAMMERS-DeLiGHt) with ESMTP id iBQKbWI02634 verified NO); Sun, 26 Dec 2004 21:37:40 +0100 (CET) (envelope-from bounce@NOSPAM.dyndns.dk) Received: (from beer@localhost) by Mail.NOSPAM.DynDNS.dK (8.11.6/FNORD) id iBQKbV102633; Sun, 26 Dec 2004 21:37:31 +0100 (CET) (envelope-from bounce@NOSPAM.dyndns.dk) Date: Sun, 26 Dec 2004 21:37:31 +0100 (CET) Message-Id: <200412262037.iBQKbV102633@Mail.NOSPAM.DynDNS.dK> X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: beer set sender to bounce@NOSPAM.dyndns.dk using -f X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: Processed from queue /tmp X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: Processed by beer with -C /etc/mail/sendmail.cf-LOCAL References: <200411301305.iAUD5Ot01166@Mail.NOSPAM.DynDNS.dK> From: Barry Bouwsma To: Firewire Developers , USB developers Mail-Followup-To: FreeBSD USB developers Subject: Re: Firewire/USB conflicting number of sectors for certain drives X-BeenThere: freebsd-firewire@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Barry Bouwsma List-Id: Firewire support in FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 26 Dec 2004 20:37:46 -0000 Happy 2004!!1! I happened to be looking at the Linux USB code and noticed their definition of quirks, and noted an interesting `FIX_CAPACITY' type of quirk that doesn't seem to be present in FreeBSD, which sounds very much like what I thought was a firewire problem (having set up my disk under USB and then failed to access the last partition with Firewire). The essence of the quirk is that the reported size with USB of some devices is 1 too large, which sounds exactly like what I am describing in the message below, which I initially posted to the firewire list. Now I think I posted the below in error, and it needs to be sent to the USB list instead, which is what I'm trying to do with this crosspost. Sorry for annoying the Firewire-fanatics with this, when it seems to be the domain of the USB-users. Here's the message, for freebsd-usb@ , and the linux code which does this is in drivers/usb/storage/ procotols.c and unusual_devs.h, for anyone who wishes to look there. thanks barry bouwsma | Date: Tue, 30 Nov 2004 14:05:24 +0100 (CET) | Message-Id: <200411301305.iAUD5Ot01166@Mail.NOSPAM.DynDNS.dK> | From: Barry Bouwsma | To: FreeBSD Firewire Developers | Subject: Firewire/USB conflicting number of sectors for certain drives | | Salut, [ ... ] | I have three different disks in front of me, all equipped with both | USB and Firewire connectors. Two of the three report a different | number of sectors -- one fewer -- when connected via firewire, than | when connected via USB1 (UHCI and apparently OHCI though I know of | access problems with the latter; have not checked against EHCI). | The third disk, however, reports the same sectors in `dmesg', and | I initially set it up connected with Firewire, while the other drives | have been set up over USB1 as the hardware which I had at hand. | | The two drives are Western Digital, hidden behind something as you | can see in the below dmesg snippets. Here the reported sectors from | them: | USB: da1: 238475MB (488397169 512 byte sectors: 255H 63S/T 30401C) | FW: da1: 238475MB (488397168 512 byte sectors: 255H 63S/T 30401C) | and | USB: da1: 190782MB (390721969 512 byte sectors: 255H 63S/T 24321C) | FW: da1: 190782MB (390721968 512 byte sectors: 255H 63S/T 24321C) | | Too bad I disklabel'ed and whatnot the disk when connected via USB, | so that any Firewire access fails to report the actual partition | where I expect to find the data (it now appears to extend beyond the | end of the disk). Hmmm. | da1s1: slice extends beyond end of disk: truncating from 488397106 to 488397105 | sectors | | The third drive -- the first one I acquired -- is a Maxtor, and does | not have this issue. I'm using kernel modules on FreeBSD 4.x, modules | built on 11.05.2004, which otherwise work splendidly, though I may have | one or two minor hacks compiled in. I haven't tried more recent source | or anything based on -current. | | | It's probably a known issue that (as you see below), the drive attached | by USB is identified by what the actual drive is, whereas when connected | via firewire, it appears to be identified as the chipset that interfaces | from firewire to the drive's ATA -- at least with my modules. | | | Here's a bit of some `dmesg' concerning the drives, although it's | not comprehensive, in case there's something to be seen below: | | exhibit 1 on usb: | umass0: ASSMANN Electronic GmbH product 0x3507, rev 2.00/0.01, addr 4 | umass0:3:0:-1: Attached to scbus3 | pass1 at umass-sim0 bus 0 target 0 lun 0 | pass1: Fixed Direct Access SCSI-0 device | pass1: 1.000MB/s transfers | Creating DISK da1 | da1 at umass-sim0 bus 0 target 0 lun 0 | da1: Fixed Direct Access SCSI-0 device | da1: 1.000MB/s transfers | da1: 238475MB (488397169 512 byte sectors: 255H 63S/T 30401C) | | exhibit 1 then connected via firewire: | pass1 at sbp0 bus 0 target 1 lun 0 | pass1: Fixed Simplified Direct Access SCSI-4 device | pass1: Serial Number \^_ | pass1: 50.000MB/s transfers | Creating DISK da1 | sbp0:1:0 sbp_cam_scan_lun | da1 at sbp0 bus 0 target 1 lun 0 | da1: Fixed Simplified Direct Access SCSI-4 device | da1: Serial Number \^_ | da1: 50.000MB/s transfers | da1: 238475MB (488397168 512 byte sectors: 255H 63S/T 30401C) | da1s1: type 0xa5, start 63, end = 488397168, size 488397106 : OK | da1s1: slice extends beyond end of disk: truncating from 488397106 to 488397105 | sectors | da1: raw partition size != slice size | da1: start 63, end 488397167, size 488397105 | da1c: start 63, end 488397168, size 488397106 | | | exhibit 2 connected via usb: | umass1: Generic USB 2.0 Storage Device, rev 2.00/0.01, addr 5 | umass1:4:1:-1: Attached to scbus4 | pass1 at umass-sim1 bus 1 target 0 lun 0 | pass1: Fixed Direct Access SCSI-0 device | pass1: 1.000MB/s transfers | Creating DISK da1 | da1 at umass-sim1 bus 1 target 0 lun 0 | da1: Fixed Direct Access SCSI-0 device | da1: 1.000MB/s transfers | da1: 190782MB (390721969 512 byte sectors: 255H 63S/T 24321C) | | and then via firewire: | da1 at sbp0 bus 0 target 1 lun 0 | da1: < 1394 to ATA 2804> Fixed Simplified Direct Access SCSI-4 device | da1: Serial Number ^_ | da1: 50.000MB/s transfers | da1: 190782MB (390721968 512 byte sectors: 255H 63S/T 24321C) | | | for reference, the Maxtor drive appears comparable with both: | usb: | umass1: Maxtor 5000XT v01.00.00, rev 2.00/1.00, addr 5 | umass1: Get Max Lun not supported (STALLED) | umass1:4:1:-1: Attached to scbus4 | pass1 at umass-sim1 bus 1 target 0 lun 0 | pass1: Fixed Direct Access SCSI-0 device | pass1: Serial Number A80A06AE | pass1: 1.000MB/s transfers | Creating DISK da1 | da1 at umass-sim1 bus 1 target 0 lun 0 | da1: Fixed Direct Access SCSI-0 device | da1: Serial Number A80A06AE | da1: 1.000MB/s transfers | da1: 239371MB (490232832 512 byte sectors: 255H 63S/T 30515C) | | firewire: | pass1 at sbp0 bus 0 target 0 lun 0 | pass1: Fixed Simplified Direct Access SCSI-4 devi | ce | pass1: Serial Number A80A06AE | pass1: 50.000MB/s transfers | Creating DISK da1 | sbp0:0:0 sbp_cam_scan_lun | da1 at sbp0 bus 0 target 0 lun 0 | da1: Fixed Simplified Direct Access SCSI-4 device | da1: Serial Number A80A06AE | da1: 50.000MB/s transfers | da1: 239371MB (490232832 512 byte sectors: 255H 63S/T 30515C)