xref: /freebsd/share/man/man4/ada.4 (revision f513d14ca41462bbb3e7a9e23a757379549461f3)
1ca17f444SAlexander Motin.\" Copyright (c) 2009 Alexander Motin <mav@FreeBSD.org>
2ca17f444SAlexander Motin.\" All rights reserved.
3ca17f444SAlexander Motin.\"
4ca17f444SAlexander Motin.\" Redistribution and use in source and binary forms, with or without
5ca17f444SAlexander Motin.\" modification, are permitted provided that the following conditions
6ca17f444SAlexander Motin.\" are met:
7ca17f444SAlexander Motin.\" 1. Redistributions of source code must retain the above copyright
8ca17f444SAlexander Motin.\"    notice, this list of conditions and the following disclaimer.
9ca17f444SAlexander Motin.\"
10ca17f444SAlexander Motin.\" 2. Redistributions in binary form must reproduce the above copyright
11ca17f444SAlexander Motin.\"    notice, this list of conditions and the following disclaimer in the
12ca17f444SAlexander Motin.\"    documentation and/or other materials provided with the distribution.
13ca17f444SAlexander Motin.\"
14ca17f444SAlexander Motin.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15ca17f444SAlexander Motin.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16ca17f444SAlexander Motin.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17ca17f444SAlexander Motin.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18ca17f444SAlexander Motin.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19ca17f444SAlexander Motin.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20ca17f444SAlexander Motin.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21ca17f444SAlexander Motin.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22ca17f444SAlexander Motin.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23ca17f444SAlexander Motin.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24ca17f444SAlexander Motin.\" SUCH DAMAGE.
25ca17f444SAlexander Motin.\"
26ca17f444SAlexander Motin.\" $FreeBSD$
27ca17f444SAlexander Motin.\"
28*f513d14cSAlexander Motin.Dd April 7, 2011
29ca17f444SAlexander Motin.Dt ADA 4
30ca17f444SAlexander Motin.Os
31ca17f444SAlexander Motin.Sh NAME
32ca17f444SAlexander Motin.Nm ada
33ca17f444SAlexander Motin.Nd ATA Direct Access device driver
34ca17f444SAlexander Motin.Sh SYNOPSIS
35ca17f444SAlexander Motin.Cd device ada
36ca17f444SAlexander Motin.Sh DESCRIPTION
37ca17f444SAlexander MotinThe
38ca17f444SAlexander Motin.Nm
39eaea8333SChristian Bruefferdriver provides support for direct access devices, implementing the
40ca17f444SAlexander Motin.Tn ATA
41ca17f444SAlexander Motincommand protocol, that are attached to the system through a host adapter
42eaea8333SChristian Brueffersupported by the CAM subsystem.
43ca17f444SAlexander Motin.Pp
44eaea8333SChristian BruefferThe host adapter must also be separately configured into the system before an
45ca17f444SAlexander Motin.Tn ATA
46ca17f444SAlexander Motindirect access device can be configured.
47ca17f444SAlexander Motin.Sh COMMAND QUEUING
48ca17f444SAlexander MotinCommand queueing allows the device to process multiple transactions
49ca17f444SAlexander Motinconcurrently, often re-ordering them to reduce the number and length of
50ca17f444SAlexander Motinseeks.
51ca17f444SAlexander Motin.Tn ATA
52ca17f444SAlexander Motindefines two types of queueing:
53ca17f444SAlexander Motin.Tn TCQ (Tagged Command Queueing, PATA legacy)
54ca17f444SAlexander Motinand
55ca17f444SAlexander Motin.Tn NCQ (Native Command Queueing, SATA) .
56ca17f444SAlexander MotinThe
57ca17f444SAlexander Motin.Nm
58eaea8333SChristian Bruefferdevice driver takes full advantage of NCQ, when supported.
59eaea8333SChristian BruefferTo ensure that transactions to distant parts of the media,
60eaea8333SChristian Bruefferwhich may be deferred indefinitely by servicing requests closer to the current
61ca17f444SAlexander Motinhead position, are completed in a timely fashion, an ordered
62ca17f444SAlexander Motintransaction is sent every 7 seconds during continuous device operation.
63ca17f444SAlexander Motin.Sh CACHE EFFECTS
64ca17f444SAlexander MotinMany direct access devices are equipped with read and/or write caches.
65ca17f444SAlexander MotinParameters affecting the device's cache are reported in device IDENTIFY data
66ca17f444SAlexander Motinand can be examined and modified via the
67ca17f444SAlexander Motin.Xr camcontrol 8
68ca17f444SAlexander Motinutility.
69ca17f444SAlexander Motin.Pp
70ca17f444SAlexander MotinThe read cache is used to store data from device-initiated read ahead
71ca17f444SAlexander Motinoperations as well as frequently used data.
72ca17f444SAlexander MotinThe read cache is transparent
73ca17f444SAlexander Motinto the user and can be enabled without any adverse effect.
74ca17f444SAlexander MotinMost devices
75ca17f444SAlexander Motinwith a read cache come from the factory with it enabled.
76ca17f444SAlexander Motin.Pp
77ca17f444SAlexander MotinThe write cache can greatly decrease the latency of write operations
78ca17f444SAlexander Motinand allows the device to reorganize writes to increase efficiency and
79ca17f444SAlexander Motinperformance.
80ca17f444SAlexander MotinThis performance gain comes at a price.
81ca17f444SAlexander MotinShould the device
82ca17f444SAlexander Motinlose power while its cache contains uncommitted write operations, these
83ca17f444SAlexander Motinwrites will be lost.
84ca17f444SAlexander MotinThe effect of a loss of write transactions on
85ca17f444SAlexander Motina file system is non-deterministic and can cause corruption.
86ca17f444SAlexander MotinMost
87eaea8333SChristian Bruefferdevices age write transactions to limit the vulnerability to a few transactions
88eaea8333SChristian Bruefferrecently reported as complete, but it is nonetheless recommended that
89ca17f444SAlexander Motinsystems with write cache enabled devices reside on an Uninterruptible
90ca17f444SAlexander MotinPower Supply (UPS).
91ca17f444SAlexander MotinThe
92ca17f444SAlexander Motin.Nm
93ca17f444SAlexander Motindevice driver ensures that the cache and media are synchronized upon
94ca17f444SAlexander Motinfinal close of the device or an unexpected shutdown (panic) event.
95ca17f444SAlexander MotinThis ensures that it is safe to disconnect power once the operating system
96ca17f444SAlexander Motinhas reported that it has halted.
97ca17f444SAlexander Motin.Sh SYSCTL VARIABLES
98ca17f444SAlexander MotinThe following variables are available as both
99ca17f444SAlexander Motin.Xr sysctl 8
100ca17f444SAlexander Motinvariables and
101ca17f444SAlexander Motin.Xr loader 8
102ca17f444SAlexander Motintunables:
103ca17f444SAlexander Motin.Bl -tag -width 12
104ca17f444SAlexander Motin.It kern.cam.ada.retry_count
105ca17f444SAlexander Motin.Pp
106ca17f444SAlexander MotinThis variable determines how many times the
107ca17f444SAlexander Motin.Nm
108ca17f444SAlexander Motindriver will retry a READ or WRITE command.
109ca17f444SAlexander MotinThis does not affect the number of retries used during probe time or for
110ca17f444SAlexander Motinthe
111ca17f444SAlexander Motin.Nm
112ca17f444SAlexander Motindriver dump routine.
113ca17f444SAlexander MotinThis value currently defaults to 4.
114ca17f444SAlexander Motin.It kern.cam.ada.default_timeout
115ca17f444SAlexander Motin.Pp
116ca17f444SAlexander MotinThis variable determines how long the
117ca17f444SAlexander Motin.Nm
118ca17f444SAlexander Motindriver will wait before timing out an outstanding command.
119ca17f444SAlexander MotinThe units for this value are seconds, and the default is currently 30
120ca17f444SAlexander Motinseconds.
121fd104c15SRebecca Cran.It kern.cam.ada.spindown_shutdown
122fd104c15SRebecca Cran.Pp
123fd104c15SRebecca CranThis variable determines whether to spin-down disks when shutting down.
124827f816cSRebecca CranSet to 1 to enable spin-down, 0 to disable.
125827f816cSRebecca CranThe default is currently enabled.
126*f513d14cSAlexander Motin.It kern.cam.ada.write_cache
127*f513d14cSAlexander Motin.Pp
128*f513d14cSAlexander MotinThis variable determines whether device write cache should be enabled or not.
129*f513d14cSAlexander MotinSet to 1 to enable write cache, 0 to disable, -1 to left it as-is.
130*f513d14cSAlexander MotinThe default is currently enabled.
131ca17f444SAlexander Motin.El
132ca17f444SAlexander Motin.Sh FILES
133ca17f444SAlexander Motin.Bl -tag -width ".Pa /dev/ada*" -compact
134ca17f444SAlexander Motin.It Pa /dev/ada*
135ca17f444SAlexander MotinATA device nodes
136ca17f444SAlexander Motin.El
137ca17f444SAlexander Motin.Sh SEE ALSO
138eaea8333SChristian Brueffer.Xr ad 4 ,
139ca17f444SAlexander Motin.Xr ahci 4 ,
1402baf3a13SAlexander Motin.Xr cam 4 ,
141eaea8333SChristian Brueffer.Xr da 4 ,
142eaea8333SChristian Brueffer.Xr siis 4
143ca17f444SAlexander Motin.Sh HISTORY
144ca17f444SAlexander MotinThe
145ca17f444SAlexander Motin.Nm
146ca17f444SAlexander Motindriver first appeared in
147ca17f444SAlexander Motin.Fx 8.0 .
148ca17f444SAlexander Motin.Sh AUTHORS
149eaea8333SChristian Brueffer.An Alexander Motin Aq mav@FreeBSD.org
150