From owner-freebsd-drivers@FreeBSD.ORG Thu Sep 20 19:23:14 2012 Return-Path: Delivered-To: freebsd-drivers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32E76106566B; Thu, 20 Sep 2012 19:23:14 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 718BF8FC0C; Thu, 20 Sep 2012 19:23:12 +0000 (UTC) Received: by lbbgg13 with SMTP id gg13so3580153lbb.13 for ; Thu, 20 Sep 2012 12:23:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding; bh=3/a92f5gNxBkWPfeC/TC+Ppb6hUBaX2iJupEPOt1EOM=; b=CgjbmL1RFZk9fb7dTUGgV5yTAESec3ICjBwDl0cZ5tY+EXiD3MntksAlrpUI1u+deR zGQEclSnw06UY8HJ0uEmvmFRReERlnkllVim/VBPsEwydD8MLeef8J6LKk4hKOUOu8zM lHPHv8rUpN3c6ErAt2yw2nfpgE875Meepa13MKsh6AnKFiEuMb5gwhUtXjXnER4mR1p8 56b2/cWBa9ZkOe7SHTnCS6sApLaKnpCTCgYdjDmt+t5XBuwVmIlx/csu++orVHx9u2eE rnGcEdwQCufbuTQAmuSNYOhpOmWBJpk3iAEworKEHdjJKBFSIMme75y/sR0SvKcH0p/9 KsOQ== Received: by 10.152.132.202 with SMTP id ow10mr2287761lab.51.1348168991090; Thu, 20 Sep 2012 12:23:11 -0700 (PDT) Received: from mavbook.mavhome.dp.ua (mavhome.mavhome.dp.ua. [213.227.240.37]) by mx.google.com with ESMTPS id ba4sm1765886lbb.14.2012.09.20.12.23.09 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 20 Sep 2012 12:23:09 -0700 (PDT) Sender: Alexander Motin Message-ID: <505B6D1B.7070506@FreeBSD.org> Date: Thu, 20 Sep 2012 22:23:07 +0300 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:13.0) Gecko/20120628 Thunderbird/13.0.1 MIME-Version: 1.0 To: jack sparrow References: <201209190825.07384.jhb@freebsd.org> <5059CC56.8040705@FreeBSD.org> In-Reply-To: <5059CC56.8040705@FreeBSD.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-drivers@freebsd.org Subject: Re: Exclusive access of SCSI/ATA devices from user space X-BeenThere: freebsd-drivers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Writing device drivers for FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Sep 2012 19:23:14 -0000 > Is there really no sorting of I/O requests inside cam passthrough > driver, or cam transport layer? Say if I send one i/o request to > selected device via cam passthrough driver and then send other one, > before previous one is completed. There is no sorting in pass driver, as it passes all requests to CAM immediately. CAM transport also does not intentionally sort requests during normal operation. In some rare error recovery cases it may be difficult to manage original request order during requests requeueing or retrying. CAM tries to do it right, but I am not sure it can be guarantied. > Do I need to modify cam transport layer also, to switch ata device > from PIO to DMA and vice versa for data transfer and to disable SATA > NCQ, and Command tag queing ; or CAM passthrough driver will be able > to do that. No, you don't need to modify. CAM provides APIs to control mode setting and command queuing via methods of the same PASS interface. If you are using pass interface, it is actually your duty to use proper command set (PIO/DMA/FPDMA) with the device, respecting current operation mode set by CAM. If CAM negotiated DMA with NCQ, you are free to use any of these kinds of commands in a mix you like. -- Alexander Motin