Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 21 Sep 2012 09:45:06 +0530
From:      Jack <jacks.1785@gmail.com>
To:        Alexander Motin <mav@freebsd.org>
Cc:        freebsd-drivers@freebsd.org
Subject:   Re: Exclusive access of SCSI/ATA devices from user space
Message-ID:  <CACmXQA2W4CBeiBvAZ5xcMAxKDHqgjwk4CaxVidMPgD%2BT_biJmw@mail.gmail.com>
In-Reply-To: <505B6D1B.7070506@FreeBSD.org>
References:  <CACmXQA09W56rSvVrprD8cuAbZ3T7hFmFKmfREiyXGOZwfpH5=g@mail.gmail.com> <201209190825.07384.jhb@freebsd.org> <5059CC56.8040705@FreeBSD.org> <505B6D1B.7070506@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On 9/21/12, Alexander Motin <mav@freebsd.org> wrote:
>  > 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
>


Thanks Alexander. So, I only need to modify da/ada/sa drivers such
that they do not attach themselves to the selected device. Then I will
access the device via CAM pass driver.

Is it possible that 2 different processes can access the same device
via cam pass through driver?

Actually there are 2 perspectives here, I'm talking about:
(  Assume we have modified da/ada/sa drivers such that they do not
attach themselves to the selected device, and utility is loaded in
main memory. )

a) While one processes is accessing the selected device via cam pass
driver, is it possible for another process to access this same
selected device via cam pass driver(it can't access through da/ada/sa
drivers as they are not attached to the selected device rightnow). I'm
trying to deactivate/disable simultaneous access to the selected
device.
	
b) Assume that none of the process is currently accessing the selected
device. Is it possible that except my utility, none of the other
userland  processes be able to access the selected device via cam pass
driver(again, it can't access through da/ada/sa drivers), even if my
utility is not accessing  the device  at this time. I mean, is there
some kind of automatic or forced locking so that only utility process
can access the selected device via CAM    passthrough driver.

-- 
Jack



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CACmXQA2W4CBeiBvAZ5xcMAxKDHqgjwk4CaxVidMPgD%2BT_biJmw>