From owner-freebsd-scsi@FreeBSD.ORG Mon Oct 3 21:24:55 2011 Return-Path: Delivered-To: scsi@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37AAA1065672; Mon, 3 Oct 2011 21:24:55 +0000 (UTC) (envelope-from ken@kdm.org) Received: from nargothrond.kdm.org (nargothrond.kdm.org [70.56.43.81]) by mx1.freebsd.org (Postfix) with ESMTP id DDCA28FC12; Mon, 3 Oct 2011 21:24:54 +0000 (UTC) Received: from nargothrond.kdm.org (localhost [127.0.0.1]) by nargothrond.kdm.org (8.14.2/8.14.2) with ESMTP id p93LOpiS072980; Mon, 3 Oct 2011 15:24:51 -0600 (MDT) (envelope-from ken@nargothrond.kdm.org) Received: (from ken@localhost) by nargothrond.kdm.org (8.14.2/8.14.2/Submit) id p93LOp3Q072979; Mon, 3 Oct 2011 15:24:51 -0600 (MDT) (envelope-from ken) Date: Mon, 3 Oct 2011 15:24:51 -0600 From: "Kenneth D. Merry" To: scsi@freebsd.org, current@freebsd.org Message-ID: <20111003212451.GA72963@nargothrond.kdm.org> References: <20110922193305.GA24939@nargothrond.kdm.org> <20111001051914.GA25534@nargothrond.kdm.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20111001051914.GA25534@nargothrond.kdm.org> User-Agent: Mutt/1.4.2i Cc: Fabian Keil Subject: Re: SCSI descriptor sense changes, testing needed X-BeenThere: freebsd-scsi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SCSI subsystem List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 03 Oct 2011 21:24:55 -0000 This has been committed to head, and the plan is to get it into stable/9 in time for 9.0. Please let me know if you run into any problems with the changes. Thanks, Ken On Fri, Sep 30, 2011 at 23:19:14 -0600, Kenneth D. Merry wrote: > > I have attached a new version of the patches, with a number of changes. > > One issue that has cropped up is that the previous sense code and my new > descriptor sense changes never paid any attention to the actual length of > the sense data returned by the controller. > > I have changed all of the error recovery code and sense printing code to > honor the sense data length in the CAM CCB. > > One other problem related to that is that many controller drivers don't set > the sense residual field in struct ccb_scsiio properly, or don't set it at > all. This patch includes changes to the isp, mps, mpt, umass, and ciss > drivers to set the sense_resid field properly. > > There are lots of other drivers in the system, however, that haven't been > audited, and may or may not set the sense residual correctly. > > I also fixed an issue reported by Fabian Keil that showed up with the ahci > driver. In reverting a change I have in my local tree to switch to a 2 > byte length field in the SCSI inquiry CDB, I accidently shortened the CDB > to 5 bytes. Oops. > > I'd really appreciate more feedback; Fabian is the only person to report > testing the previous patch. > > Thanks, > > Ken > > On Thu, Sep 22, 2011 at 13:33:05 -0600, Kenneth D. Merry wrote: > > > > I have attached a set of patches against head that implement SCSI > > descriptor sense support for CAM. > > > > Descriptor sense is a new sense (SCSI error) format introduced in the SPC-3 > > spec in 2006. FreeBSD doesn't currently support it. > > > > Seagate's new 3TB SAS drives come with descriptor sense enabled by default, > > and it's possible that other newer drives do as well. Because all the > > sense key, additional sense code, and additional sense code qualifier > > fields are in different places, the CAM error recovery code will not do the > > right thing when it gets descriptor sense. > > > > These patches do bump up the size of struct scsi_sense_data, and so I have > > incremented CAM_VERSION as well. I have discussed this with re@, and it > > looks like we'll be putting the changes in before 9.0, so it ships with > > support for newer SCSI devices. > > > > A number of things have changed in these patches, but in particular, it > > would be good to test the following: > > > > - The sa(4) (SCSI tape) driver. The residual handling code, which looks > > at the sense data, has changed. > > - The Playstation 3 CDROM driver. > > - Firewire target mode. > > - umass devices with the NO_INQUIRY_EVPD quirk. > > > > Also, please let me know if you see any anomalies with the sense printing > > code. In the common cases the output should look identical to the old > > code, but in some cases it will be a little different. e.g.: > > > > # camcontrol inquiry da40 -v > > pass47: Fixed Direct Access SCSI-6 device > > pass47: Serial Number 9XK0GAJ70000S125XDNU > > pass47: 300.000MB/s transfers, Command Queueing Enabled > > > > (Seagate 3TB drive) > > > > # camcontrol modepage da40 -m 10 |grep D_SENSE > > D_SENSE: 1 > > > > (Descriptor sense is enabled) > > > > # camcontrol modepage da40 -m 15 -v > > (pass47:mps1:0:47:0): MODE SENSE(6). CDB: 1a 0 4f 0 ff 0 > > (pass47:mps1:0:47:0): CAM status: SCSI Status Error > > (pass47:mps1:0:47:0): SCSI status: Check Condition > > (pass47:mps1:0:47:0): SCSI sense: ILLEGAL REQUEST asc:24,0 (Invalid field in CDB) > > (pass47:mps1:0:47:0): Field Replaceable Unit: 1 > > (pass47:mps1:0:47:0): Command byte 2 bit 5 is invalid > > (pass47:mps1:0:47:0): Descriptor 0x80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 > > camcontrol: error sending mode sense command > > > > (The FRU and Sense Key Specific entries are on separate lines, and a > > vendor-specific sense descriptor is printed out in hex format.) > > > > Anyway, I'd appreciate any testing and feedback on these changes. As I > > said, they will probably be in 9.0, so if there are any issues it would be > > better to find them now. :) > > > > Thanks, > > > > Ken > > -- > > Kenneth Merry > > ken@FreeBSD.ORG > -- > Kenneth Merry > ken@FreeBSD.ORG -- Kenneth Merry ken@FreeBSD.ORG