237 lines
4.3 KiB
HTML
237 lines
4.3 KiB
HTML
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>timeout</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.76b+
|
|
"><LINK
|
|
REL="HOME"
|
|
TITLE="The Linux SCSI Generic (sg) HOWTO"
|
|
HREF="index.html"><LINK
|
|
REL="UP"
|
|
TITLE="The sg_io_hdr_t structure in detail"
|
|
HREF="sg_io_hdr_t.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="sbp"
|
|
HREF="x212.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="flags"
|
|
HREF="x233.html"></HEAD
|
|
><BODY
|
|
CLASS="SECT1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>The Linux SCSI Generic (sg) HOWTO</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x212.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
>Chapter 6. The sg_io_hdr_t structure in detail</TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="x233.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="SECT1"
|
|
><H1
|
|
CLASS="SECT1"
|
|
><A
|
|
NAME="AEN215">6.10. timeout</H1
|
|
><P
|
|
>This value is used to timeout the given command. The units of this
|
|
value are milliseconds. The time being measured is from when a command
|
|
is sent until when sg is informed the request has been completed. A
|
|
following read() can take as long as the user likes. Timeouts are best
|
|
avoided, especially if SCSI bus resets will adversely effect other
|
|
devices on that SCSI bus. When the timeout expires, the SCSI mid level
|
|
attempts error recovery. Error recovery completes when the first action
|
|
in the following list is successful. Note that a more extreme measure
|
|
is being taken at each step.
|
|
<P
|
|
></P
|
|
><UL
|
|
><LI
|
|
><P
|
|
>
|
|
the SCSI command that has timed out is aborted
|
|
<A
|
|
NAME="AEN221"
|
|
HREF="#FTN.AEN221"
|
|
>[1]</A
|
|
></P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>
|
|
a SCSI device reset is attempted</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>
|
|
a SCSI bus reset is attempted. Note this may have an adverse effect on
|
|
other devices sharing that SCSI bus.</P
|
|
></LI
|
|
><LI
|
|
><P
|
|
>
|
|
a SCSI host (bus adapter) reset is attempted. This is an attempt to
|
|
re-initialize the adapter card associated with the SCSI device that
|
|
has the timed out command.</P
|
|
></LI
|
|
></UL
|
|
>
|
|
If all these fail then the device may be set "offline" which means that
|
|
it is no longer accessible (except by this driver when open()-ed
|
|
O_NONBLOCK) until the machine is rebooted. Offline devices still
|
|
appear in the <B
|
|
CLASS="COMMAND"
|
|
>cat /proc/scsi/scsi</B
|
|
> listing. The
|
|
last column of the <B
|
|
CLASS="COMMAND"
|
|
>cat /proc/scsi/sg/devices</B
|
|
>
|
|
listing shows the online/offline status of a device ("1" means online
|
|
while "0" is offline). The exact status returned depends on which
|
|
level of error recovery succeeded. Most likely the 'host_status' will be
|
|
set to DID_ABORT or DID_RESET.</P
|
|
><P
|
|
>The two error statuses containing the word "TIME(_)OUT" are typically
|
|
_not_ related to a command timing out. DID_TIME_OUT in the 'host_status'
|
|
usually means an (unexpected) device selection timeout. DRIVER_TIMEOUT in
|
|
the 'driver_status' byte means the SCSI adapter is unable to control the
|
|
devices on its SCSI bus (and has given up).</P
|
|
><P
|
|
>The type of timeout is unsigned int (and it represents milliseconds).</P
|
|
></DIV
|
|
><H3
|
|
CLASS="FOOTNOTES"
|
|
>Notes</H3
|
|
><TABLE
|
|
BORDER="0"
|
|
CLASS="FOOTNOTES"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
WIDTH="5%"
|
|
><A
|
|
NAME="FTN.AEN221"
|
|
HREF="x215.html#AEN221"
|
|
>[1]</A
|
|
></TD
|
|
><TD
|
|
ALIGN="LEFT"
|
|
VALIGN="TOP"
|
|
WIDTH="95%"
|
|
><P
|
|
>Whether aborting individual commands is supported or not is left to
|
|
the adapter. Many adapters are unable to abort SCSI commands "in flight"
|
|
because these details are handled in silicon by embedded processors
|
|
in hardware. SCSI device or bus resets are required.</P
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x212.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="x233.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>sbp</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="sg_io_hdr_t.html"
|
|
ACCESSKEY="U"
|
|
>Up</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>flags</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |