summaryrefslogtreecommitdiffstats
path: root/share/man/man4/da.4
diff options
context:
space:
mode:
authorken <ken@FreeBSD.org>2003-09-03 04:46:28 +0000
committerken <ken@FreeBSD.org>2003-09-03 04:46:28 +0000
commit03d0445c1692534218893d0f76a5232a12769935 (patch)
tree54485ba0616eea8f013a6221f95c3b93a70168ce /share/man/man4/da.4
parent96db6adb01216f8a587311123b15f9ae3c246431 (diff)
downloadFreeBSD-src-03d0445c1692534218893d0f76a5232a12769935.zip
FreeBSD-src-03d0445c1692534218893d0f76a5232a12769935.tar.gz
Move dynamic sysctl(8) variable creation for the cd(4) and da(4) drivers
out of cdregister() and daregister(), which are run from interrupt context. The sysctl code does blocking mallocs (M_WAITOK), which causes problems if malloc(9) actually needs to sleep. The eventual fix for this issue will involve moving the CAM probe process inside a kernel thread. For now, though, I have fixed the issue by moving dynamic sysctl variable creation for these two drivers to a task queue running in a kernel thread. The existing task queues (taskqueue_swi and taskqueue_swi_giant) run in software interrupt handlers, which wouldn't fix the problem at hand. So I have created a new task queue, taskqueue_thread, that runs inside a kernel thread. (It also runs outside of Giant -- clients must explicitly acquire and release Giant in their taskqueue functions.) scsi_cd.c: Remove sysctl variable creation code from cdregister(), and move it to a new function, cdsysctlinit(). Queue cdsysctlinit() to the taskqueue_thread taskqueue once we have fully registered the cd(4) driver instance. scsi_da.c: Remove sysctl variable creation code from daregister(), and move it to move it to a new function, dasysctlinit(). Queue dasysctlinit() to the taskqueue_thread taskqueue once we have fully registered the da(4) instance. taskqueue.h: Declare the new taskqueue_thread taskqueue, update some comments. subr_taskqueue.c: Create the new kernel thread taskqueue. This taskqueue runs outside of Giant, so any functions queued to it would need to explicitly acquire/release Giant if they need it. cd.4: Update the cd(4) man page to talk about the minimum command size sysctl/loader tunable. Also note that the changer variables are available as loader tunables as well. da.4: Update the da(4) man page to cover the retry_count, default_timeout and minimum_cmd_size sysctl variables/loader tunables. Remove references to /dev/r???, they aren't used any longer. cd.9: Update the cd(9) man page to describe the CD_Q_10_BYTE_ONLY quirk. taskqueue.9: Update the taskqueue(9) man page to describe the new thread task queue, and the taskqueue_swi_giant queue. MFC after: 3 days
Diffstat (limited to 'share/man/man4/da.4')
-rw-r--r--share/man/man4/da.496
1 files changed, 54 insertions, 42 deletions
diff --git a/share/man/man4/da.4 b/share/man/man4/da.4
index 835f4fd..c35b59f 100644
--- a/share/man/man4/da.4
+++ b/share/man/man4/da.4
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 15, 1998
+.Dd September 2, 2003
.Dt DA 4
.Os
.Sh NAME
@@ -196,6 +196,59 @@ The driver
.Em will
write the new disklabel to the disk.
.El
+.Sh SYSCTL VARIABLES
+The following variables are available as both
+.Xr sysctl 8
+variables and
+.Xr loader 8
+tunables:
+.Bl -tag -width 12
+.It kern.cam.da.retry_count
+.Pp
+This variable determines how many times the
+.Nm
+driver will retry a READ or WRITE command.
+This does not affect the number of retries used during probe time or for
+the
+.Nm
+driver dump routine.
+This value currently defaults to 4.
+.It kern.cam.da.default_timeout
+.Pp
+This variable determines how long the
+.Nm
+driver will wait before timing out an outstanding command.
+The units for this value are seconds, and the default is currently 60
+seconds.
+.It kern.cam.da.%d.minimum_cmd_size
+.Pp
+This variable determines what the minimum READ/WRITE CDB size is for a
+given
+.Nm
+unit.
+(The %d above denotes the unit number of the
+.Nm
+driver instance, e.g. 1, 2, 4, 8, etc.)
+Valid minimum command size values are 6, 10, 12 and 16 bytes.
+The default is 6 bytes.
+.Pp
+The
+.Nm
+driver issues a CAM Path Inquiry CCB at probe time to determine whether the
+protocol the device in question speaks (e.g. ATAPI) typically doesn't allow
+6 byte commands.
+If it doesn't, the
+.Nm
+driver will default to using at least 10 byte CDBs.
+If a 6 byte READ or WRITE fails with an ILLEGAL REQUEST error, the
+.Nm
+driver will then increase the default CDB size for the device to 10 bytes and
+retry the command.
+CDB size is always
+chosen as the smallest READ/WRITE CDB that will satisfy the specified minimum
+command size, and the LBA and length of the READ or WRITE in question.
+(e.g., a write to an LBA larger than 2^32 will require a 16 byte CDB.)
+.El
.Sh NOTES
If a device becomes invalidated (media is removed, device becomes unresponsive)
the disklabel and information held within the kernel about the device will
@@ -206,25 +259,9 @@ the last file descriptor referencing the old device is closed.
During this period, all new open attempts will be rejected.
.Sh FILES
.Bl -tag -width /dev/rsdXXXXX -compact
-.It Pa /dev/rda Ns Ar u
-raw mode
-.Tn SCSI
-disk unit
-.Ar u ,
-accessed as an unpartitioned device
.Sm off
.It Pa /dev/da Ar u Pa s Ar n
.Sm on
-block mode
-.Tn SCSI
-disk unit
-.Ar u ,
-slice
-.Ar n ,
-accessed as an unpartitioned device
-.Sm off
-.It Pa /dev/rda Ar u Pa s Ar n
-.Sm on
raw mode
.Tn SCSI
disk unit
@@ -233,15 +270,6 @@ slice
.Ar n ,
accessed as an unpartitioned device
.It Pa /dev/da Ns Ar u Ns Ar p
-block mode
-.Tn SCSI
-disk unit
-.Ar u ,
-first
-.Fx
-slice, partition
-.Ar p
-.It Pa /dev/rda Ns Ar u Ns Ar p
raw mode
.Tn SCSI
disk unit
@@ -259,22 +287,6 @@ slice, partition
.Ar p
.Xc
.Sm on
-block mode
-.Tn SCSI
-disk unit
-.Ar u ,
-.Ar n Ns th
-slice, partition
-.Ar p
-.Sm off
-.It Xo
-.Pa /dev/rda
-.Ar u
-.Pa s
-.Ar n
-.Ar p
-.Xc
-.Sm on
raw mode
.Tn SCSI
disk unit
OpenPOWER on IntegriCloud