public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@steeleye.com>
To: Douglas Gilbert <dougg@torque.net>
Cc: SCSI Mailing List <linux-scsi@vger.kernel.org>
Subject: scsi_mid_low_api.txt update to clarify queuecommand return values
Date: 01 Feb 2004 10:46:23 -0500	[thread overview]
Message-ID: <1075650384.1817.9.camel@mulgrave> (raw)

The only documentation about the MLQUEUE returns is in the code, it
should also be in here.  I'll add this if no-one objects.

James

===== scsi_mid_low_api.txt 1.15 vs edited =====
--- 1.15/Documentation/scsi/scsi_mid_low_api.txt	Fri Sep 26 20:07:12 2003
+++ edited/scsi_mid_low_api.txt	Sun Feb  1 10:45:23 2004
@@ -1091,14 +1091,44 @@
  *      @scp: pointer to scsi command object
  *      @done: function pointer to be invoked on completion
  *
- *      Returns 0 on success and 1 if the LLD or the HBA is busy (i.e. run
- *      out of resources to queue further commands). Other types of errors
- *      that are detected immediately are flagged by setting scp->result 
- *      to an appropriate value, invoking the 'done' callback, and then
- *      returning 0 from this function. If the command is not performed
- *      immediately (and the LLD is starting (or will start) the given
- *      command) then this function should place 0 in scp->result and
- *      return 0.
+ *      Returns 0 on success.
+ *
+ *	If there's a failure, return either:
+ *
+ *	SCSI_MLQUEUE_DEVICE_BUSY if the device queue is full, or
+ *	SCSI_MLQUEUE_HOST_BUSY if the entire host queue is full
+ *
+ *	On both of these returns, the mid-layer will requeue the I/O
+ *
+ *	- if the return is SCSI_MLQUEUE_DEVICE_BUSY, only that particular
+ *	device will be paused, and it will be unpaused when a command to
+ *	the device returns (or after a brief delay if there are no more
+ *	outstanding commands to it).  Commands to other devices continue
+ *	to be processed normally.
+ *
+ *	- if the return is SCSI_MLQUEUE_HOST_BUSY, all I/O to the host
+ *	is paused and will be unpaused when any command returns from
+ *	the host (or after a brief delay if there are no outstanding
+ *	commands to the host).
+ *
+ *	For compatibility with earlier versions of queuecommand, any
+ *	other return value is treated the same as
+ *	SCSI_MLQUEUE_HOST_BUSY.
+ *
+ *	Other types of errors that are detected immediately may be
+ *	flagged by setting scp->result to an appropriate value,
+ *	invoking the 'done' callback, and then returning 0 from this
+ *	function. If the command is not performed immediately (and the
+ *	LLD is starting (or will start) the given command) then this
+ *	function should place 0 in scp->result and return 0.
+ *
+ *	Command ownership.  If the driver returns zero, it owns the
+ *	command and must take responsibility for ensuring the 'done'
+ *	callback is executed.  Note: the driver may call done before
+ *	returning zero, but after it has called done, it may not
+ *	return any value other than zero.  If the driver makes a
+ *	non-zero return, it must not execute the command's done
+ *	callback at any time.
  *
  *      Locks: struct Scsi_Host::host_lock held on entry (with "irqsave")
  *             and is expected to be held on return.


                 reply	other threads:[~2004-02-01 15:46 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1075650384.1817.9.camel@mulgrave \
    --to=james.bottomley@steeleye.com \
    --cc=dougg@torque.net \
    --cc=linux-scsi@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox