Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
linux
Commits
6837ef4f
Commit
6837ef4f
authored
Oct 27, 2002
by
James Bottomley
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SCSI] documentation tidy ups and an interface fix in mlqueue_insert
parent
740ec8b5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
36 additions
and
8 deletions
+36
-8
drivers/scsi/hosts.h
drivers/scsi/hosts.h
+25
-3
drivers/scsi/scsi.c
drivers/scsi/scsi.c
+11
-5
No files found.
drivers/scsi/hosts.h
View file @
6837ef4f
...
@@ -142,9 +142,31 @@ typedef struct SHT
...
@@ -142,9 +142,31 @@ typedef struct SHT
* Host number is the POSITION IN THE hosts array of THIS
* Host number is the POSITION IN THE hosts array of THIS
* host adapter.
* host adapter.
*
*
* The done() function must only be called after QueueCommand()
* if queuecommand returns 0, then the HBA has accepted the
* has returned.
* command. The done() function must be called on the command
*/
* when the driver has finished with it. (you may call done on the
* command before queuecommand returns, but in this case you
* *must* return 0 from queuecommand).
*
* queuecommand may also reject the command, in which case it may
* not touch the command and must not call done() for it.
*
* There are two possible rejection returns:
*
* SCSI_MLQUEUE_DEVICE_BUSY: Block this device temporarily, but
* allow commands to other devices serviced by this host.
*
* SCSI_MLQUEUE_HOST_BUSY: Block all devices served by this
* host temporarily.
*
* for compatibility, any other non-zero return is treated the
* same as SCSI_MLQUEUE_HOST_BUSY.
*
* NOTE: "temporarily" means either until the next command for
* this device/host completes, or a period of time determined by
* I/O pressure in the system if there are no other outstanding
* commands.
* */
int
(
*
queuecommand
)(
Scsi_Cmnd
*
,
void
(
*
done
)(
Scsi_Cmnd
*
));
int
(
*
queuecommand
)(
Scsi_Cmnd
*
,
void
(
*
done
)(
Scsi_Cmnd
*
));
/*
/*
...
...
drivers/scsi/scsi.c
View file @
6837ef4f
...
@@ -661,6 +661,7 @@ inline void __scsi_release_command(Scsi_Cmnd * SCpnt)
...
@@ -661,6 +661,7 @@ inline void __scsi_release_command(Scsi_Cmnd * SCpnt)
int
scsi_mlqueue_insert
(
Scsi_Cmnd
*
cmd
,
int
reason
)
int
scsi_mlqueue_insert
(
Scsi_Cmnd
*
cmd
,
int
reason
)
{
{
struct
Scsi_Host
*
host
=
cmd
->
host
;
struct
Scsi_Host
*
host
=
cmd
->
host
;
struct
scsi_device
*
device
=
cmd
->
device
;
unsigned
long
flags
;
unsigned
long
flags
;
SCSI_LOG_MLQUEUE
(
1
,
SCSI_LOG_MLQUEUE
(
1
,
...
@@ -688,7 +689,7 @@ int scsi_mlqueue_insert(Scsi_Cmnd * cmd, int reason)
...
@@ -688,7 +689,7 @@ int scsi_mlqueue_insert(Scsi_Cmnd * cmd, int reason)
if
(
reason
==
SCSI_MLQUEUE_HOST_BUSY
)
{
if
(
reason
==
SCSI_MLQUEUE_HOST_BUSY
)
{
host
->
host_blocked
=
host
->
max_host_blocked
;
host
->
host_blocked
=
host
->
max_host_blocked
;
}
else
{
}
else
{
cmd
->
device
->
device_blocked
=
cmd
->
device
->
max_device_blocked
;
device
->
device_blocked
=
device
->
max_device_blocked
;
}
}
/*
/*
...
@@ -702,14 +703,19 @@ int scsi_mlqueue_insert(Scsi_Cmnd * cmd, int reason)
...
@@ -702,14 +703,19 @@ int scsi_mlqueue_insert(Scsi_Cmnd * cmd, int reason)
* Decrement the counters, since these commands are no longer
* Decrement the counters, since these commands are no longer
* active on the host/device.
* active on the host/device.
*/
*/
spin_lock_irqsave
(
cmd
->
host
->
host_lock
,
flags
);
scsi_host_busy_dec_and_test
(
host
,
device
);
cmd
->
host
->
host_busy
--
;
cmd
->
device
->
device_busy
--
;
spin_unlock_irqrestore
(
cmd
->
host
->
host_lock
,
flags
);
/*
/*
* Insert this command at the head of the queue for it's device.
* Insert this command at the head of the queue for it's device.
* It will go before all other commands that are already in the queue.
* It will go before all other commands that are already in the queue.
*
* NOTE: there is magic here about the way the queue is
* plugged if we have no outstanding commands.
* scsi_insert_special_cmd eventually calls
* blk_queue_insert(). Although this *doesn't* plug the
* queue, it does call the request function. The SCSI request
* function detects the blocked condition and plugs the queue
* appropriately.
*/
*/
scsi_insert_special_cmd
(
cmd
,
1
);
scsi_insert_special_cmd
(
cmd
,
1
);
return
0
;
return
0
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment