Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 252440
b: refs/heads/master
c: 8f0722c
h: refs/heads/master
v: v3
  • Loading branch information
Vikas Chaudhary authored and James Bottomley committed May 24, 2011
1 parent dc56081 commit 4788a58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 20 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1b46807e0bc6160449ce04a207fa98a694bc443c
refs/heads/master: 8f0722cae6a799e0cd5f1eb5ed4569a11f8dcf79
26 changes: 7 additions & 19 deletions trunk/drivers/scsi/qla4xxx/ql4_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,8 +412,7 @@ void qla4xxx_mark_all_devices_missing(struct scsi_qla_host *ha)

static struct srb* qla4xxx_get_new_srb(struct scsi_qla_host *ha,
struct ddb_entry *ddb_entry,
struct scsi_cmnd *cmd,
void (*done)(struct scsi_cmnd *))
struct scsi_cmnd *cmd)
{
struct srb *srb;

Expand All @@ -427,7 +426,6 @@ static struct srb* qla4xxx_get_new_srb(struct scsi_qla_host *ha,
srb->cmd = cmd;
srb->flags = 0;
CMD_SP(cmd) = (void *)srb;
cmd->scsi_done = done;

return srb;
}
Expand Down Expand Up @@ -458,9 +456,8 @@ void qla4xxx_srb_compl(struct kref *ref)

/**
* qla4xxx_queuecommand - scsi layer issues scsi command to driver.
* @host: scsi host
* @cmd: Pointer to Linux's SCSI command structure
* @done_fn: Function that the driver calls to notify the SCSI mid-layer
* that the command has been processed.
*
* Remarks:
* This routine is invoked by Linux to send a SCSI command to the driver.
Expand All @@ -470,10 +467,9 @@ void qla4xxx_srb_compl(struct kref *ref)
* completion handling). Unfortunely, it sometimes calls the scheduler
* in interrupt context which is a big NO! NO!.
**/
static int qla4xxx_queuecommand_lck(struct scsi_cmnd *cmd,
void (*done)(struct scsi_cmnd *))
static int qla4xxx_queuecommand(struct Scsi_Host *host, struct scsi_cmnd *cmd)
{
struct scsi_qla_host *ha = to_qla_host(cmd->device->host);
struct scsi_qla_host *ha = to_qla_host(host);
struct ddb_entry *ddb_entry = cmd->device->hostdata;
struct iscsi_cls_session *sess = ddb_entry->sess;
struct srb *srb;
Expand Down Expand Up @@ -515,37 +511,29 @@ static int qla4xxx_queuecommand_lck(struct scsi_cmnd *cmd,
test_bit(DPC_RESET_HA_FW_CONTEXT, &ha->dpc_flags))
goto qc_host_busy;

spin_unlock_irq(ha->host->host_lock);

srb = qla4xxx_get_new_srb(ha, ddb_entry, cmd, done);
srb = qla4xxx_get_new_srb(ha, ddb_entry, cmd);
if (!srb)
goto qc_host_busy_lock;
goto qc_host_busy;

rval = qla4xxx_send_command_to_isp(ha, srb);
if (rval != QLA_SUCCESS)
goto qc_host_busy_free_sp;

spin_lock_irq(ha->host->host_lock);
return 0;

qc_host_busy_free_sp:
qla4xxx_srb_free_dma(ha, srb);
mempool_free(srb, ha->srb_mempool);

qc_host_busy_lock:
spin_lock_irq(ha->host->host_lock);

qc_host_busy:
return SCSI_MLQUEUE_HOST_BUSY;

qc_fail_command:
done(cmd);
cmd->scsi_done(cmd);

return 0;
}

static DEF_SCSI_QCMD(qla4xxx_queuecommand)

/**
* qla4xxx_mem_free - frees memory allocated to adapter
* @ha: Pointer to host adapter structure.
Expand Down

0 comments on commit 4788a58

Please sign in to comment.