From owner-freebsd-current@FreeBSD.ORG Sat Jun 6 23:33:19 2009 Return-Path: Delivered-To: freebsd-current@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C9319106564A; Sat, 6 Jun 2009 23:33:19 +0000 (UTC) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (apollo.backplane.com [216.240.41.2]) by mx1.freebsd.org (Postfix) with ESMTP id D96D38FC12; Sat, 6 Jun 2009 23:33:17 +0000 (UTC) (envelope-from dillon@apollo.backplane.com) Received: from apollo.backplane.com (localhost [127.0.0.1]) by apollo.backplane.com (8.14.2/8.14.1) with ESMTP id n56NXHeZ090342; Sat, 6 Jun 2009 16:33:17 -0700 (PDT) Received: (from dillon@localhost) by apollo.backplane.com (8.14.2/8.13.4/Submit) id n56NXH6a090341; Sat, 6 Jun 2009 16:33:17 -0700 (PDT) Date: Sat, 6 Jun 2009 16:33:17 -0700 (PDT) From: Matthew Dillon Message-Id: <200906062333.n56NXH6a090341@apollo.backplane.com> To: Alexander Motin References: <6657.1244328220@critter.freebsd.dk> <4A2AF876.1030103@FreeBSD.org> Cc: FreeBSD-Current , freebsd-arch@FreeBSD.org Subject: Re: WIP: ATA to CAM integration X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Jun 2009 23:33:20 -0000 I found the ATAPI_C_ATAPI_IDENTIFY command that was mentioned and it works fine, returning the same sort of information for ATAPI attachments that ATA_C_IDENTIFY returns for DISK attachments. That takes care of the queue length negotiation by the device. However, there is no fis->command that I can find that would allow NCQ to operate in ATAPI mode. In ATAPI mode fis->command is typically set to ATA_C_PACKET. In DISK mode fis->command is set to ATA_C_READ_FPDMA or ATA_C_WRITE_FPDMA (the first-person DMA mode used by AHCI's NCQ). So unless the *_FPDMA FIS commands work for an ATAPI attached device, we are S.O.L. Section 5.6.4.1: The ATA/ATAPI-7 queued feature set is not supported by AHCI (including READ QUEUED (EXT), WRITE QUEUED (EXT), and SERVICE commands). Queued operations are supported in AHCI using the READ FPDMA QUEUED and WRITE FPDMA QUEUED commands when the HBA and device support native command queueing. It is unclear whether an ATAPI device would accept a non-packet command, aka ATA_C_READ_FPDMA or ATA_C_WRITE_FPDMA, instead of ATA_C_PACKET. ATAPI devices do support the ATAPI_C_ATAPI_IDENTIFY command, which is non-packet command, so maybe its possible. If it is possible it would only work for READ and WRITE commands, since those are the only commands the FPDMA modes can be used for. The AHCI spec doesn't explicitly say that the FPDMA commands would not work for an ATAPI attached device, so there's hope. What we need is a SATA ATAPI device which says it supports NCQ + has a queue length > 1 to test with. -Matt Matthew Dillon