diff options
author | Vikas Chaudhary <vikas.chaudhary@qlogic.com> | 2011-05-18 02:17:10 -0400 |
---|---|---|
committer | James Bottomley <jbottomley@parallels.com> | 2011-05-24 12:40:12 -0400 |
commit | 8f0722cae6a799e0cd5f1eb5ed4569a11f8dcf79 (patch) | |
tree | d639bc2bf6d9ab47133c78cd88e2cb49b5608879 /drivers/scsi | |
parent | 1b46807e0bc6160449ce04a207fa98a694bc443c (diff) |
[SCSI] qla4xxx: Remove host_lock in queuecommand function
Signed-off-by: Vikas Chaudhary <vikas.chaudhary@qlogic.com>
Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>
Signed-off-by: James Bottomley <jbottomley@parallels.com>
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/qla4xxx/ql4_os.c | 26 |
1 files changed, 7 insertions, 19 deletions
diff --git a/drivers/scsi/qla4xxx/ql4_os.c b/drivers/scsi/qla4xxx/ql4_os.c index 9c1c8453d6c7..9bfe9ce28740 100644 --- a/drivers/scsi/qla4xxx/ql4_os.c +++ b/drivers/scsi/qla4xxx/ql4_os.c | |||
@@ -412,8 +412,7 @@ void qla4xxx_mark_all_devices_missing(struct scsi_qla_host *ha) | |||
412 | 412 | ||
413 | static struct srb* qla4xxx_get_new_srb(struct scsi_qla_host *ha, | 413 | static struct srb* qla4xxx_get_new_srb(struct scsi_qla_host *ha, |
414 | struct ddb_entry *ddb_entry, | 414 | struct ddb_entry *ddb_entry, |
415 | struct scsi_cmnd *cmd, | 415 | struct scsi_cmnd *cmd) |
416 | void (*done)(struct scsi_cmnd *)) | ||
417 | { | 416 | { |
418 | struct srb *srb; | 417 | struct srb *srb; |
419 | 418 | ||
@@ -427,7 +426,6 @@ static struct srb* qla4xxx_get_new_srb(struct scsi_qla_host *ha, | |||
427 | srb->cmd = cmd; | 426 | srb->cmd = cmd; |
428 | srb->flags = 0; | 427 | srb->flags = 0; |
429 | CMD_SP(cmd) = (void *)srb; | 428 | CMD_SP(cmd) = (void *)srb; |
430 | cmd->scsi_done = done; | ||
431 | 429 | ||
432 | return srb; | 430 | return srb; |
433 | } | 431 | } |
@@ -458,9 +456,8 @@ void qla4xxx_srb_compl(struct kref *ref) | |||
458 | 456 | ||
459 | /** | 457 | /** |
460 | * qla4xxx_queuecommand - scsi layer issues scsi command to driver. | 458 | * qla4xxx_queuecommand - scsi layer issues scsi command to driver. |
459 | * @host: scsi host | ||
461 | * @cmd: Pointer to Linux's SCSI command structure | 460 | * @cmd: Pointer to Linux's SCSI command structure |
462 | * @done_fn: Function that the driver calls to notify the SCSI mid-layer | ||
463 | * that the command has been processed. | ||
464 | * | 461 | * |
465 | * Remarks: | 462 | * Remarks: |
466 | * This routine is invoked by Linux to send a SCSI command to the driver. | 463 | * This routine is invoked by Linux to send a SCSI command to the driver. |
@@ -470,10 +467,9 @@ void qla4xxx_srb_compl(struct kref *ref) | |||
470 | * completion handling). Unfortunely, it sometimes calls the scheduler | 467 | * completion handling). Unfortunely, it sometimes calls the scheduler |
471 | * in interrupt context which is a big NO! NO!. | 468 | * in interrupt context which is a big NO! NO!. |
472 | **/ | 469 | **/ |
473 | static int qla4xxx_queuecommand_lck(struct scsi_cmnd *cmd, | 470 | static int qla4xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd) |
474 | void (*done)(struct scsi_cmnd *)) | ||
475 | { | 471 | { |
476 | struct scsi_qla_host *ha = to_qla_host(cmd->device->host); | 472 | struct scsi_qla_host *ha = to_qla_host(host); |
477 | struct ddb_entry *ddb_entry = cmd->device->hostdata; | 473 | struct ddb_entry *ddb_entry = cmd->device->hostdata; |
478 | struct iscsi_cls_session *sess = ddb_entry->sess; | 474 | struct iscsi_cls_session *sess = ddb_entry->sess; |
479 | struct srb *srb; | 475 | struct srb *srb; |
@@ -515,37 +511,29 @@ static int qla4xxx_queuecommand_lck(struct scsi_cmnd *cmd, | |||
515 | test_bit(DPC_RESET_HA_FW_CONTEXT, &ha->dpc_flags)) | 511 | test_bit(DPC_RESET_HA_FW_CONTEXT, &ha->dpc_flags)) |
516 | goto qc_host_busy; | 512 | goto qc_host_busy; |
517 | 513 | ||
518 | spin_unlock_irq(ha->host->host_lock); | 514 | srb = qla4xxx_get_new_srb(ha, ddb_entry, cmd); |
519 | |||
520 | srb = qla4xxx_get_new_srb(ha, ddb_entry, cmd, done); | ||
521 | if (!srb) | 515 | if (!srb) |
522 | goto qc_host_busy_lock; | 516 | goto qc_host_busy; |
523 | 517 | ||
524 | rval = qla4xxx_send_command_to_isp(ha, srb); | 518 | rval = qla4xxx_send_command_to_isp(ha, srb); |
525 | if (rval != QLA_SUCCESS) | 519 | if (rval != QLA_SUCCESS) |
526 | goto qc_host_busy_free_sp; | 520 | goto qc_host_busy_free_sp; |
527 | 521 | ||
528 | spin_lock_irq(ha->host->host_lock); | ||
529 | return 0; | 522 | return 0; |
530 | 523 | ||
531 | qc_host_busy_free_sp: | 524 | qc_host_busy_free_sp: |
532 | qla4xxx_srb_free_dma(ha, srb); | 525 | qla4xxx_srb_free_dma(ha, srb); |
533 | mempool_free(srb, ha->srb_mempool); | 526 | mempool_free(srb, ha->srb_mempool); |
534 | 527 | ||
535 | qc_host_busy_lock: | ||
536 | spin_lock_irq(ha->host->host_lock); | ||
537 | |||
538 | qc_host_busy: | 528 | qc_host_busy: |
539 | return SCSI_MLQUEUE_HOST_BUSY; | 529 | return SCSI_MLQUEUE_HOST_BUSY; |
540 | 530 | ||
541 | qc_fail_command: | 531 | qc_fail_command: |
542 | done(cmd); | 532 | cmd->scsi_done(cmd); |
543 | 533 | ||
544 | return 0; | 534 | return 0; |
545 | } | 535 | } |
546 | 536 | ||
547 | static DEF_SCSI_QCMD(qla4xxx_queuecommand) | ||
548 | |||
549 | /** | 537 | /** |
550 | * qla4xxx_mem_free - frees memory allocated to adapter | 538 | * qla4xxx_mem_free - frees memory allocated to adapter |
551 | * @ha: Pointer to host adapter structure. | 539 | * @ha: Pointer to host adapter structure. |