aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid/megaraid_mbox.c
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2010-11-16 02:10:29 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2010-11-16 16:33:23 -0500
commitf281233d3eba15fb225d21ae2e228fd4553d824a (patch)
tree51134454ba8acb558735f90be5540f7d756483e3 /drivers/scsi/megaraid/megaraid_mbox.c
parentbdbd01ac444bffb3c9aefed3059d12554059b320 (diff)
SCSI host lock push-down
Move the mid-layer's ->queuecommand() invocation from being locked with the host lock to being unlocked to facilitate speeding up the critical path for drivers who don't need this lock taken anyway. The patch below presents a simple SCSI host lock push-down as an equivalent transformation. No locking or other behavior should change with this patch. All existing bugs and locking orders are preserved. Additionally, add one parameter to queuecommand, struct Scsi_Host * and remove one parameter from queuecommand, void (*done)(struct scsi_cmnd *) Scsi_Host* is a convenient pointer that most host drivers need anyway, and 'done' is redundant to struct scsi_cmnd->scsi_done. Minimal code disturbance was attempted with this change. Most drivers needed only two one-line modifications for their host lock push-down. Signed-off-by: Jeff Garzik <jgarzik@redhat.com> Acked-by: James Bottomley <James.Bottomley@suse.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/scsi/megaraid/megaraid_mbox.c')
-rw-r--r--drivers/scsi/megaraid/megaraid_mbox.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/scsi/megaraid/megaraid_mbox.c b/drivers/scsi/megaraid/megaraid_mbox.c
index a7810a106b3..5708cb27d07 100644
--- a/drivers/scsi/megaraid/megaraid_mbox.c
+++ b/drivers/scsi/megaraid/megaraid_mbox.c
@@ -113,8 +113,7 @@ static int megaraid_mbox_fire_sync_cmd(adapter_t *);
113static void megaraid_mbox_display_scb(adapter_t *, scb_t *); 113static void megaraid_mbox_display_scb(adapter_t *, scb_t *);
114static void megaraid_mbox_setup_device_map(adapter_t *); 114static void megaraid_mbox_setup_device_map(adapter_t *);
115 115
116static int megaraid_queue_command(struct scsi_cmnd *, 116static int megaraid_queue_command(struct Scsi_Host *, struct scsi_cmnd *);
117 void (*)(struct scsi_cmnd *));
118static scb_t *megaraid_mbox_build_cmd(adapter_t *, struct scsi_cmnd *, int *); 117static scb_t *megaraid_mbox_build_cmd(adapter_t *, struct scsi_cmnd *, int *);
119static void megaraid_mbox_runpendq(adapter_t *, scb_t *); 118static void megaraid_mbox_runpendq(adapter_t *, scb_t *);
120static void megaraid_mbox_prepare_pthru(adapter_t *, scb_t *, 119static void megaraid_mbox_prepare_pthru(adapter_t *, scb_t *,
@@ -1484,7 +1483,7 @@ mbox_post_cmd(adapter_t *adapter, scb_t *scb)
1484 * Queue entry point for mailbox based controllers. 1483 * Queue entry point for mailbox based controllers.
1485 */ 1484 */
1486static int 1485static int
1487megaraid_queue_command(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *)) 1486megaraid_queue_command_lck(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))
1488{ 1487{
1489 adapter_t *adapter; 1488 adapter_t *adapter;
1490 scb_t *scb; 1489 scb_t *scb;
@@ -1513,6 +1512,8 @@ megaraid_queue_command(struct scsi_cmnd *scp, void (*done)(struct scsi_cmnd *))
1513 return if_busy; 1512 return if_busy;
1514} 1513}
1515 1514
1515static DEF_SCSI_QCMD(megaraid_queue_command)
1516
1516/** 1517/**
1517 * megaraid_mbox_build_cmd - transform the mid-layer scsi commands 1518 * megaraid_mbox_build_cmd - transform the mid-layer scsi commands
1518 * @adapter : controller's soft state 1519 * @adapter : controller's soft state