summaryrefslogtreecommitdiffstats
path: root/share/man/man4/cd.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/cd.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/cd.4')
-rw-r--r--share/man/man4/cd.437
1 files changed, 34 insertions, 3 deletions
diff --git a/share/man/man4/cd.4 b/share/man/man4/cd.4
index 579fcea..7c491f5 100644
--- a/share/man/man4/cd.4
+++ b/share/man/man4/cd.4
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd October 10, 1998
+.Dd September 2, 2003
.Dt CD 4
.Os
.Sh NAME
@@ -370,6 +370,37 @@ Some work is planned to support
some of the more common `broken'
.Tn CD-ROM
drives; however, this is not yet under way.
+.Pp
+The
+.Nm
+driver attempts to automatically determine whether the drive it is talking
+to supports 6 byte or 10 byte MODE SENSE/MODE SELECT operations. Many
+.Tn SCSI
+drives only support 6 byte commands, and
+.Tn ATAPI
+drives only support 10 byte commands.
+The
+.Nm
+driver first attempts to determine whether the protocol in use typically
+supports 6 byte commands by issuing a CAM Path Inquiry CCB.
+It will then default to 6 byte or 10 byte commands as appropriate.
+After that, the
+.Nm
+driver defaults to using 6 byte commands (assuming the protocol the drive
+speaks claims to support 6 byte commands), until one fails with a
+.Tn SCSI
+ILLEGAL REQUEST error. Then it tries the 10 byte version of the command to
+see if that works instead. Users can change the default via per-drive
+sysctl variables and loader tunables. The variable names are the same in
+both instances:
+.Pp
+.Va kern.cam.cd.%d.minimum_cmd_size
+.Pp
+Where
+.Dq %d
+is the unit number of the drive in question. Valid minimum command sizes
+are 6 and 10. Any value above 6 will be rounded to 10, and any value below
+6 will be rounded to 6.
.Sh CHANGER OPERATION
This driver has built-in support for LUN-based CD changers.
A LUN-based CD
@@ -399,7 +430,7 @@ If there is no outstanding I/O for
another LUN, the driver will allow indefinite access to a given LUN.
.Pp
The minimum and maximum time quanta are configurable via kernel options and
-also via sysctl variables.
+also via sysctl and kernel tunable variables.
The kernel options are:
.Pp
.Bl -item -compact
@@ -409,7 +440,7 @@ The kernel options are:
.Cd "options ""CHANGER_MAX_BUSY_SECONDS=11"""
.El
.Pp
-The sysctl variables are:
+The sysctl/kernel tunable variables are:
.Pp
.Bl -item -compact
.It
OpenPOWER on IntegriCloud