From owner-freebsd-scsi Sun Feb 16 21:45:20 2003 Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 2F16837B401; Sun, 16 Feb 2003 21:45:18 -0800 (PST) Received: from panzer.kdm.org (panzer.kdm.org [216.160.178.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id 095D843F85; Sun, 16 Feb 2003 21:45:17 -0800 (PST) (envelope-from ken@panzer.kdm.org) Received: from panzer.kdm.org (localhost [127.0.0.1]) by panzer.kdm.org (8.12.6/8.12.5) with ESMTP id h1H5jEnU084717; Sun, 16 Feb 2003 22:45:14 -0700 (MST) (envelope-from ken@panzer.kdm.org) Received: (from ken@localhost) by panzer.kdm.org (8.12.6/8.12.5/Submit) id h1H5jEHa084716; Sun, 16 Feb 2003 22:45:14 -0700 (MST) (envelope-from ken) Date: Sun, 16 Feb 2003 22:45:14 -0700 From: "Kenneth D. Merry" To: Thomas Quinot Cc: scsi@FreeBSD.ORG, current@FreeBSD.ORG, joe@FreeBSD.ORG Subject: Re: call for testers: cd(4) changes Message-ID: <20030216224513.A84634@panzer.kdm.org> References: <20030214232001.A71462@panzer.kdm.org> <20030215112046.GA20707@melusine.cuivre.fr.eu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030215112046.GA20707@melusine.cuivre.fr.eu.org>; from thomas@FreeBSD.ORG on Sat, Feb 15, 2003 at 12:20:46PM +0100 Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sat, Feb 15, 2003 at 12:20:46 +0100, Thomas Quinot wrote: > Le 2003-02-15, Kenneth D. Merry écrivait : > > > - Automatically detect CDROM drives that can't handle 6 byte mode > > sense and mode select, and adjust our command size accordingly. > > More information on that below. > > > > - MODE_SENSE and MODE_SELECT translation removed in ATAPICAM and in > > the umass(4) driver, since there's no way for that to work properly > > (see below). > > I'm afraid things are not as simple as that. Unfortunately you cannot > expect ATAPI drives to properly reject MODE_{SENSE,SELECT}_6 and try the > _10 variants in that case: the reason why ATAPICAM inconditionnally > translates the _6 commands into _10 is because some ATAPI drives have > been found to lock up when they rececive the _6 commands, whereas the > ATAPI specification only mandates the implementation of the _10 > versions. The translation produces bogus results, so we can't really keep it around. In the mode sense case, the caller will be looking in the wrong place for the page. In the mode select page, the drive will be looking for the page at the wrong offset, and the page will be truncated. The two alternatives I can think of are getting the CAM_NEW_TRAN_CODE working, so we'll know that drives that talk ATAPI can't do 10 byte mode sense/select, or quirking drives that are known to hang when they get 6 byte commands. The long term plan is the first alternative; that really is the cleanest way to do it. In the short term, I'll put in a quirk mechanism. I'll be somewhat strict about making submitters prove that the drive has a problem, and documenting it in a PR audit trail. (The same sort of approach Nate is using with the da(4) driver quirks.) We should be able to remove all drives with the 10 byte quirk once we get the CAM_NEW_TRAN_CODE done. > > - The media validation routine also reads the table of contents off > > the drive. > > Great! That could also allow the creation of per-track /dev nodes, as > acd has. Yep. Ken -- Kenneth Merry ken@kdm.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message From owner-freebsd-scsi Mon Feb 17 11: 2:40 2003 Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 6AFDE37B406 for ; Mon, 17 Feb 2003 11:02:39 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8E8B843FF9 for ; Mon, 17 Feb 2003 11:02:27 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: from freefall.freebsd.org (peter@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id h1HJ2ONS070882 for ; Mon, 17 Feb 2003 11:02:24 -0800 (PST) (envelope-from owner-bugmaster@freebsd.org) Received: (from peter@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id h1HJ2N1f070877 for scsi@freebsd.org; Mon, 17 Feb 2003 11:02:23 -0800 (PST) Date: Mon, 17 Feb 2003 11:02:23 -0800 (PST) Message-Id: <200302171902.h1HJ2N1f070877@freefall.freebsd.org> X-Authentication-Warning: freefall.freebsd.org: peter set sender to owner-bugmaster@freebsd.org using -f From: FreeBSD bugmaster To: scsi@FreeBSD.org Subject: Current problem reports assigned to you Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Current FreeBSD problem reports Critical problems Serious problems Non-critical problems S Submitted Tracker Resp. Description ------------------------------------------------------------------------------- f [1999/12/21] kern/15608 scsi acd0 / cd0 give inconsistent errors on em 1 problem total. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message From owner-freebsd-scsi Tue Feb 18 21:52:21 2003 Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 0C10637B401; Tue, 18 Feb 2003 21:52:20 -0800 (PST) Received: from panzer.kdm.org (panzer.kdm.org [216.160.178.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id B03EA43F85; Tue, 18 Feb 2003 21:52:18 -0800 (PST) (envelope-from ken@panzer.kdm.org) Received: from panzer.kdm.org (localhost [127.0.0.1]) by panzer.kdm.org (8.12.6/8.12.5) with ESMTP id h1J5qHnU096459; Tue, 18 Feb 2003 22:52:17 -0700 (MST) (envelope-from ken@panzer.kdm.org) Received: (from ken@localhost) by panzer.kdm.org (8.12.6/8.12.5/Submit) id h1J5qHNH096458; Tue, 18 Feb 2003 22:52:17 -0700 (MST) (envelope-from ken) Date: Tue, 18 Feb 2003 22:52:17 -0700 From: "Kenneth D. Merry" To: Thomas Quinot Cc: scsi@FreeBSD.ORG, current@FreeBSD.ORG, joe@FreeBSD.ORG Subject: Re: call for testers: cd(4) changes Message-ID: <20030218225217.A96402@panzer.kdm.org> References: <20030214232001.A71462@panzer.kdm.org> <20030215112046.GA20707@melusine.cuivre.fr.eu.org> <20030216224513.A84634@panzer.kdm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.2.5.1i In-Reply-To: <20030216224513.A84634@panzer.kdm.org>; from ken@kdm.org on Sun, Feb 16, 2003 at 10:45:14PM -0700 Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sun, Feb 16, 2003 at 22:45:14 -0700, Kenneth D. Merry wrote: > On Sat, Feb 15, 2003 at 12:20:46 +0100, Thomas Quinot wrote: > > Le 2003-02-15, Kenneth D. Merry écrivait : > > > > > - Automatically detect CDROM drives that can't handle 6 byte mode > > > sense and mode select, and adjust our command size accordingly. > > > More information on that below. > > > > > > - MODE_SENSE and MODE_SELECT translation removed in ATAPICAM and in > > > the umass(4) driver, since there's no way for that to work properly > > > (see below). > > > > I'm afraid things are not as simple as that. Unfortunately you cannot > > expect ATAPI drives to properly reject MODE_{SENSE,SELECT}_6 and try the > > _10 variants in that case: the reason why ATAPICAM inconditionnally > > translates the _6 commands into _10 is because some ATAPI drives have > > been found to lock up when they rececive the _6 commands, whereas the > > ATAPI specification only mandates the implementation of the _10 > > versions. > > The translation produces bogus results, so we can't really keep it around. > In the mode sense case, the caller will be looking in the wrong place for > the page. In the mode select page, the drive will be looking for the page > at the wrong offset, and the page will be truncated. > > The two alternatives I can think of are getting the CAM_NEW_TRAN_CODE > working, so we'll know that drives that talk ATAPI can't do 10 byte mode > sense/select, or quirking drives that are known to hang when they get 6 > byte commands. > > The long term plan is the first alternative; that really is the cleanest > way to do it. In the short term, I'll put in a quirk mechanism. I'll be > somewhat strict about making submitters prove that the drive has a > problem, and documenting it in a PR audit trail. (The same sort of > approach Nate is using with the da(4) driver quirks.) We should be able > to remove all drives with the 10 byte quirk once we get the > CAM_NEW_TRAN_CODE done. I've got a new patchset with the quirk definition and comments in there: http://people.FreeBSD.org/~ken/scsi_cd.cmdsize.20030217 I'm planning to check it in Thursday, assuming I have time. Ken -- Kenneth Merry ken@kdm.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message From owner-freebsd-scsi Thu Feb 20 0:47:12 2003 Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C808537B401; Thu, 20 Feb 2003 00:47:10 -0800 (PST) Received: from cain.gsoft.com.au (genesi.lnk.telstra.net [139.130.136.161]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1160943F3F; Thu, 20 Feb 2003 00:47:08 -0800 (PST) (envelope-from doconnor@gsoft.com.au) Received: from [127.0.0.1] (localhost [127.0.0.1]) by cain.gsoft.com.au (8.12.4/8.12.6) with ESMTP id h1K8l3js067770; Thu, 20 Feb 2003 19:17:03 +1030 (CST) (envelope-from doconnor@gsoft.com.au) X-Authentication-Warning: cain.gsoft.com.au: Host localhost [127.0.0.1] claimed to be [127.0.0.1] Subject: Curious SCSI and/or Firewire Problem From: "Daniel O'Connor" To: FreeBSD Stable List Cc: freebsd-scsi@freebsd.org Content-Type: text/plain Organization: Message-Id: <1045730822.40318.19.camel@chowder.gsoft.com.au> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.2.2 Date: 20 Feb 2003 19:17:03 +1030 Content-Transfer-Encoding: 7bit X-Spam-Score: 1.1 (*) CARRIAGE_RETURNS,SPAM_PHRASE_00_01 X-Scanned-By: MIMEDefang 2.16 (www . roaringpenguin . com / mimedefang) Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I am testing a firewire enclosure and a SCSI card. The SCSI card is an Init-IO 940/950 and I obtained a driver from someone who back ported it from OpenBSD (hopefully it will be committed soon :) I notice that the firewire enclosure does ~20-25Mb/sec by itself, and the SCSI disk (old slow 1Gb) does 4.5Mb/sec by itself. If I run them both they act very bursty - neither runs at full usage all of the time, or at top speed. These measurement are made with 'systat -vmstat 1'. It is almost as if they are blocking each other in the kernel, but I'm not sure. My disk exerciser consists of dd'ing from /dev/zero into a file on the disks. The machine is running 4.7 from a few days ago. Anyone have any ideas what it could be? I haven't tried it with the IDE disk that is on this system yet. -- Daniel O'Connor software and network engineer for Genesis Software - http://www.gsoft.com.au "The nice thing about standards is that there are so many of them to choose from." -- Andrew Tanenbaum GPG Fingerprint - 9A8C 569F 685A D928 5140 AE4B 319B 41F4 5D17 FDD5 To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message From owner-freebsd-scsi Thu Feb 20 9:41:43 2003 Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 9802937B405 for ; Thu, 20 Feb 2003 09:41:42 -0800 (PST) Received: from rootlabs.com (root.org [67.118.192.226]) by mx1.FreeBSD.org (Postfix) with SMTP id 6227F43FD7 for ; Thu, 20 Feb 2003 09:41:40 -0800 (PST) (envelope-from nate@rootlabs.com) Received: (qmail 51525 invoked by uid 1000); 20 Feb 2003 17:41:37 -0000 Date: Thu, 20 Feb 2003 09:41:37 -0800 (PST) From: Nate Lawson To: Daniel O'Connor Cc: FreeBSD Stable List , freebsd-scsi@freebsd.org Subject: Re: Curious SCSI and/or Firewire Problem In-Reply-To: <1045730822.40318.19.camel@chowder.gsoft.com.au> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On 20 Feb 2003, Daniel O'Connor wrote: > I am testing a firewire enclosure and a SCSI card. The SCSI card is an > Init-IO 940/950 and I obtained a driver from someone who back ported it > from OpenBSD (hopefully it will be committed soon :) > > I notice that the firewire enclosure does ~20-25Mb/sec by itself, and > the SCSI disk (old slow 1Gb) does 4.5Mb/sec by itself. If I run them > both they act very bursty - neither runs at full usage all of the time, > or at top speed. You can get more info with "camcontrol debug -T all". Or the information may be under -I. Either way, my suspicion is that the old drive is holding the bus for a long time. Also, do "ps axl" between bursts to see where your dd process is blocked. -Nate To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message From owner-freebsd-scsi Thu Feb 20 22:27:30 2003 Delivered-To: freebsd-scsi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id F048637B401; Thu, 20 Feb 2003 22:27:26 -0800 (PST) Received: from panzer.kdm.org (panzer.kdm.org [216.160.178.169]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8205443FF3; Thu, 20 Feb 2003 22:27:16 -0800 (PST) (envelope-from ken@panzer.kdm.org) Received: from panzer.kdm.org (localhost [127.0.0.1]) by panzer.kdm.org (8.12.6/8.12.5) with ESMTP id h1L6RFnU009314; Thu, 20 Feb 2003 23:27:15 -0700 (MST) (envelope-from ken@panzer.kdm.org) Received: (from ken@localhost) by panzer.kdm.org (8.12.6/8.12.5/Submit) id h1L6RFv5009313; Thu, 20 Feb 2003 23:27:15 -0700 (MST) (envelope-from ken) Date: Thu, 20 Feb 2003 23:27:14 -0700 From: "Kenneth D. Merry" To: current@FreeBSD.org Cc: scsi@FreeBSD.org Subject: HEADS UP: cd(4) and da(4) changes Message-ID: <20030220232714.A9269@panzer.kdm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Sender: owner-freebsd-scsi@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org I've (finally) checked in the cd(4) mode sense/select patches, along with a number of related fixes. Note that the 6 byte sysctl for the da(4) driver has changed. It is now kern.cam.da.%d.minimum_cmd_size. i.e. there is a separate sysctl for each da unit, since you could have different drives with different requirements in one system. The sysctl for the cd(4) driver follows the same pattern: kern.cam.cd.%d.minimum_cmd_size. For the cd(4) driver it only affects mode sense and mode select. For CDROM devices, 10 byte reads and writes are the only commands that are mandated by the spec, so that's generally what it uses anyway. Also, all sysctls in the da(4) and cd(4) drivers are accessible as loader tunables now. For the rest, see the commit message below. Let me know if you see any problems resulting from this commit. Ken ----- Forwarded message from "Kenneth D. Merry" ----- From: "Kenneth D. Merry" Date: Thu, 20 Feb 2003 22:19:38 -0800 (PST) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org Subject: cvs commit: src/sys/dev/ata atapi-cam.c src/sys/dev/usb umass.c src/sys/cam/scsi scsi_all.c scsi_all.h scsi_cd.c scsi_cd.h scsi_da.c ken 2003/02/20 22:19:38 PST Modified files: sys/dev/ata atapi-cam.c sys/dev/usb umass.c sys/cam/scsi scsi_all.c scsi_all.h scsi_cd.c scsi_cd.h scsi_da.c Log: Fix ATAPI/USB/Firewire CDROM drive handling in cd(4) and hopefully fix a number of related problems along the way. - Automatically detect CDROM drives that can't handle 6 byte mode sense and mode select, and adjust our command size accordingly. We have to handle this in the cd(4) driver (where the buffers are allocated), since the parameter list length is different for the 6 and 10 byte mode sense commands. - Remove MODE_SENSE and MODE_SELECT translation removed in ATAPICAM and in the umass(4) driver, since there's no way for that to work properly. - Add a quirk entry for CDROM drives that just hang when they get a 6 byte mode sense or mode select. The reason for the quirk must be documented in a PR, and all quirks must be approved by ken@FreeBSD.org. This is to make sure that we fully understand why each quirk is needed. Once the CAM_NEW_TRAN_CODE is finished, we should be able to remove any such quirks, since we'll know what protocol the drive speaks (SCSI, ATAPI, etc.) and therefore whether we should use 6 or 10 byte mode sense/select commands. - Change the way the da(4) handles the no_6_byte sysctl. There is now a per-drive sysctl to set the minimum command size for that particular disk. (Since you could have multiple disks with multiple requirements in one system.) - Loader tunable support for all the sysctls in the da(4) and cd(4) drivers. - Add a CDIOCCLOSE ioctl for cd(4) (bde pointed this out a long time ago). - Add a media validation routine (cdcheckmedia()) to the cd(4) driver, to fix some problems bde pointed out a long time ago. We now allow open() to succeed no matter what, but if we don't detect valid media, the user can only issue CDIOCCLOSE or CDIOCEJECT ioctls. - The media validation routine also reads the table of contents off the drive. We use the table of contents to implement the CDIOCPLAYTRACKS ioctl using the PLAY AUDIO MSF command. The PLAY AUDIO TRACK INDEX command that we previously used was deprecated after SCSI-2. It works in every SCSI CDROM I've tried, but doesn't seem to work on ATAPI CDROM drives. We still use the play audio track index command if we don't have a valid TOC, but I suppose it'll fail anyway in that case. - Add _len() versions of scsi_mode_sense() and scsi_mode_select() so that we can specify the minimum command length. - Fix a couple of formatting problems in the sense printing code. MFC after: 4 weeks Revision Changes Path 1.39 +31 -4 src/sys/cam/scsi/scsi_all.c 1.22 +17 -0 src/sys/cam/scsi/scsi_all.h 1.72 +925 -264 src/sys/cam/scsi/scsi_cd.c 1.7 +54 -31 src/sys/cam/scsi/scsi_cd.h 1.127 +89 -8 src/sys/cam/scsi/scsi_da.c 1.13 +0 -30 src/sys/dev/ata/atapi-cam.c 1.76 +0 -27 src/sys/dev/usb/umass.c ----- End forwarded message ----- -- Kenneth Merry ken@kdm.org To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-scsi" in the body of the message