diff options
author | Jeff Garzik <jeff@garzik.org> | 2010-11-16 02:10:29 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2010-11-16 16:33:23 -0500 |
commit | f281233d3eba15fb225d21ae2e228fd4553d824a (patch) | |
tree | 51134454ba8acb558735f90be5540f7d756483e3 /drivers/scsi/pcmcia | |
parent | bdbd01ac444bffb3c9aefed3059d12554059b320 (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/pcmcia')
-rw-r--r-- | drivers/scsi/pcmcia/nsp_cs.c | 4 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/nsp_cs.h | 3 | ||||
-rw-r--r-- | drivers/scsi/pcmcia/sym53c500_cs.c | 4 |
3 files changed, 7 insertions, 4 deletions
diff --git a/drivers/scsi/pcmcia/nsp_cs.c b/drivers/scsi/pcmcia/nsp_cs.c index 9326c2c14880..be3f33d31a99 100644 --- a/drivers/scsi/pcmcia/nsp_cs.c +++ b/drivers/scsi/pcmcia/nsp_cs.c | |||
@@ -184,7 +184,7 @@ static void nsp_scsi_done(struct scsi_cmnd *SCpnt) | |||
184 | SCpnt->scsi_done(SCpnt); | 184 | SCpnt->scsi_done(SCpnt); |
185 | } | 185 | } |
186 | 186 | ||
187 | static int nsp_queuecommand(struct scsi_cmnd *SCpnt, | 187 | static int nsp_queuecommand_lck(struct scsi_cmnd *SCpnt, |
188 | void (*done)(struct scsi_cmnd *)) | 188 | void (*done)(struct scsi_cmnd *)) |
189 | { | 189 | { |
190 | #ifdef NSP_DEBUG | 190 | #ifdef NSP_DEBUG |
@@ -264,6 +264,8 @@ static int nsp_queuecommand(struct scsi_cmnd *SCpnt, | |||
264 | return 0; | 264 | return 0; |
265 | } | 265 | } |
266 | 266 | ||
267 | static DEF_SCSI_QCMD(nsp_queuecommand) | ||
268 | |||
267 | /* | 269 | /* |
268 | * setup PIO FIFO transfer mode and enable/disable to data out | 270 | * setup PIO FIFO transfer mode and enable/disable to data out |
269 | */ | 271 | */ |
diff --git a/drivers/scsi/pcmcia/nsp_cs.h b/drivers/scsi/pcmcia/nsp_cs.h index d68c9f267c5e..7fc9a9d0a448 100644 --- a/drivers/scsi/pcmcia/nsp_cs.h +++ b/drivers/scsi/pcmcia/nsp_cs.h | |||
@@ -299,8 +299,7 @@ static int nsp_proc_info ( | |||
299 | off_t offset, | 299 | off_t offset, |
300 | int length, | 300 | int length, |
301 | int inout); | 301 | int inout); |
302 | static int nsp_queuecommand(struct scsi_cmnd *SCpnt, | 302 | static int nsp_queuecommand(struct Scsi_Host *h, struct scsi_cmnd *SCpnt); |
303 | void (* done)(struct scsi_cmnd *SCpnt)); | ||
304 | 303 | ||
305 | /* Error handler */ | 304 | /* Error handler */ |
306 | /*static int nsp_eh_abort (struct scsi_cmnd *SCpnt);*/ | 305 | /*static int nsp_eh_abort (struct scsi_cmnd *SCpnt);*/ |
diff --git a/drivers/scsi/pcmcia/sym53c500_cs.c b/drivers/scsi/pcmcia/sym53c500_cs.c index 0ae27cb5cd6f..8552296edaa1 100644 --- a/drivers/scsi/pcmcia/sym53c500_cs.c +++ b/drivers/scsi/pcmcia/sym53c500_cs.c | |||
@@ -547,7 +547,7 @@ SYM53C500_info(struct Scsi_Host *SChost) | |||
547 | } | 547 | } |
548 | 548 | ||
549 | static int | 549 | static int |
550 | SYM53C500_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | 550 | SYM53C500_queue_lck(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) |
551 | { | 551 | { |
552 | int i; | 552 | int i; |
553 | int port_base = SCpnt->device->host->io_port; | 553 | int port_base = SCpnt->device->host->io_port; |
@@ -583,6 +583,8 @@ SYM53C500_queue(struct scsi_cmnd *SCpnt, void (*done)(struct scsi_cmnd *)) | |||
583 | return 0; | 583 | return 0; |
584 | } | 584 | } |
585 | 585 | ||
586 | static DEF_SCSI_QCMD(SYM53C500_queue) | ||
587 | |||
586 | static int | 588 | static int |
587 | SYM53C500_host_reset(struct scsi_cmnd *SCpnt) | 589 | SYM53C500_host_reset(struct scsi_cmnd *SCpnt) |
588 | { | 590 | { |