Skip to content

Commit

Permalink
[SCSI] qla2xxx: Remove reference to request queue from scsi request b…
Browse files Browse the repository at this point in the history
…lock.

srbs used to maintain a reference to the request queue on which
it was enqueued. This is no longer required as the request queue
pointer is now maintained in the scsi host that issues the srb.

Signed-off-by: Anirban Chakraborty <anirban.chakraborty@qlogic.com>
Signed-off-by: Andrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
  • Loading branch information
Anirban Chakraborty authored and James Bottomley committed May 20, 2009
1 parent 68ca949 commit 67c2e93
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 25 deletions.
2 changes: 0 additions & 2 deletions drivers/scsi/qla2xxx/qla_def.h
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,6 @@ struct req_que;
* SCSI Request Block
*/
typedef struct srb {
struct req_que *que;
struct fc_port *fcport;

struct scsi_cmnd *cmd; /* Linux SCSI command pkt */
Expand Down Expand Up @@ -2010,7 +2009,6 @@ typedef struct vport_params {
#define VP_RET_CODE_NOT_FOUND 6

struct qla_hw_data;
struct req_que;
struct rsp_que;
/*
* ISP operations
Expand Down
20 changes: 16 additions & 4 deletions drivers/scsi/qla2xxx/qla_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -3177,8 +3177,14 @@ qla2x00_loop_resync(scsi_qla_host_t *vha)
{
int rval = QLA_SUCCESS;
uint32_t wait_time;
struct req_que *req = vha->req;
struct rsp_que *rsp = req->rsp;
struct req_que *req;
struct rsp_que *rsp;

if (ql2xmultique_tag)
req = vha->hw->req_q_map[0];
else
req = vha->req;
rsp = req->rsp;

atomic_set(&vha->loop_state, LOOP_UPDATE);
clear_bit(ISP_ABORT_RETRY, &vha->dpc_flags);
Expand Down Expand Up @@ -4163,13 +4169,19 @@ qla24xx_configure_vhba(scsi_qla_host_t *vha)
uint16_t mb[MAILBOX_REGISTER_COUNT];
struct qla_hw_data *ha = vha->hw;
struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
struct req_que *req = vha->req;
struct rsp_que *rsp = req->rsp;
struct req_que *req;
struct rsp_que *rsp;

if (!vha->vp_idx)
return -EINVAL;

rval = qla2x00_fw_ready(base_vha);
if (ql2xmultique_tag)
req = ha->req_q_map[0];
else
req = vha->req;
rsp = req->rsp;

if (rval == QLA_SUCCESS) {
clear_bit(RESET_MARKER_NEEDED, &vha->dpc_flags);
qla2x00_marker(vha, req, rsp, 0, 0, MK_SYNC_ALL);
Expand Down
22 changes: 8 additions & 14 deletions drivers/scsi/qla2xxx/qla_iocb.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,10 @@ qla2x00_calc_iocbs_64(uint16_t dsds)
* Returns a pointer to the Continuation Type 0 IOCB packet.
*/
static inline cont_entry_t *
qla2x00_prep_cont_type0_iocb(struct req_que *req, struct scsi_qla_host *vha)
qla2x00_prep_cont_type0_iocb(struct scsi_qla_host *vha)
{
cont_entry_t *cont_pkt;
struct req_que *req = vha->req;
/* Adjust ring index. */
req->ring_index++;
if (req->ring_index == req->length) {
Expand All @@ -121,10 +122,11 @@ qla2x00_prep_cont_type0_iocb(struct req_que *req, struct scsi_qla_host *vha)
* Returns a pointer to the continuation type 1 IOCB packet.
*/
static inline cont_a64_entry_t *
qla2x00_prep_cont_type1_iocb(struct req_que *req, scsi_qla_host_t *vha)
qla2x00_prep_cont_type1_iocb(scsi_qla_host_t *vha)
{
cont_a64_entry_t *cont_pkt;

struct req_que *req = vha->req;
/* Adjust ring index. */
req->ring_index++;
if (req->ring_index == req->length) {
Expand Down Expand Up @@ -160,7 +162,6 @@ void qla2x00_build_scsi_iocbs_32(srb_t *sp, cmd_entry_t *cmd_pkt,
struct scsi_cmnd *cmd;
struct scatterlist *sg;
int i;
struct req_que *req;

cmd = sp->cmd;

Expand All @@ -175,8 +176,6 @@ void qla2x00_build_scsi_iocbs_32(srb_t *sp, cmd_entry_t *cmd_pkt,
}

vha = sp->fcport->vha;
req = sp->que;

cmd_pkt->control_flags |= cpu_to_le16(qla2x00_get_cmd_direction(sp));

/* Three DSDs are available in the Command Type 2 IOCB */
Expand All @@ -193,7 +192,7 @@ void qla2x00_build_scsi_iocbs_32(srb_t *sp, cmd_entry_t *cmd_pkt,
* Seven DSDs are available in the Continuation
* Type 0 IOCB.
*/
cont_pkt = qla2x00_prep_cont_type0_iocb(req, vha);
cont_pkt = qla2x00_prep_cont_type0_iocb(vha);
cur_dsd = (uint32_t *)&cont_pkt->dseg_0_address;
avail_dsds = 7;
}
Expand Down Expand Up @@ -221,7 +220,6 @@ void qla2x00_build_scsi_iocbs_64(srb_t *sp, cmd_entry_t *cmd_pkt,
struct scsi_cmnd *cmd;
struct scatterlist *sg;
int i;
struct req_que *req;

cmd = sp->cmd;

Expand All @@ -236,8 +234,6 @@ void qla2x00_build_scsi_iocbs_64(srb_t *sp, cmd_entry_t *cmd_pkt,
}

vha = sp->fcport->vha;
req = sp->que;

cmd_pkt->control_flags |= cpu_to_le16(qla2x00_get_cmd_direction(sp));

/* Two DSDs are available in the Command Type 3 IOCB */
Expand All @@ -255,7 +251,7 @@ void qla2x00_build_scsi_iocbs_64(srb_t *sp, cmd_entry_t *cmd_pkt,
* Five DSDs are available in the Continuation
* Type 1 IOCB.
*/
cont_pkt = qla2x00_prep_cont_type1_iocb(req, vha);
cont_pkt = qla2x00_prep_cont_type1_iocb(vha);
cur_dsd = (uint32_t *)cont_pkt->dseg_0_address;
avail_dsds = 5;
}
Expand Down Expand Up @@ -354,7 +350,6 @@ qla2x00_start_scsi(srb_t *sp)
/* Build command packet */
req->current_outstanding_cmd = handle;
req->outstanding_cmds[handle] = sp;
sp->que = req;
sp->cmd->host_scribble = (unsigned char *)(unsigned long)handle;
req->cnt -= req_cnt;

Expand Down Expand Up @@ -655,7 +650,7 @@ qla24xx_build_scsi_iocbs(srb_t *sp, struct cmd_type_7 *cmd_pkt,
}

vha = sp->fcport->vha;
req = sp->que;
req = vha->req;

/* Set transfer direction */
if (cmd->sc_data_direction == DMA_TO_DEVICE) {
Expand Down Expand Up @@ -686,7 +681,7 @@ qla24xx_build_scsi_iocbs(srb_t *sp, struct cmd_type_7 *cmd_pkt,
* Five DSDs are available in the Continuation
* Type 1 IOCB.
*/
cont_pkt = qla2x00_prep_cont_type1_iocb(req, vha);
cont_pkt = qla2x00_prep_cont_type1_iocb(vha);
cur_dsd = (uint32_t *)cont_pkt->dseg_0_address;
avail_dsds = 5;
}
Expand Down Expand Up @@ -728,7 +723,6 @@ qla24xx_start_scsi(srb_t *sp)
ret = 0;

qla25xx_set_que(sp, &req, &rsp);
sp->que = req;

/* So we know we haven't pci_map'ed anything yet */
tot_dsds = 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/qla2xxx/qla_mbx.c
Original file line number Diff line number Diff line change
Expand Up @@ -2232,7 +2232,7 @@ qla24xx_abort_command(srb_t *sp)
fc_port_t *fcport = sp->fcport;
struct scsi_qla_host *vha = fcport->vha;
struct qla_hw_data *ha = vha->hw;
struct req_que *req = sp->que;
struct req_que *req = vha->req;

DEBUG11(printk("%s(%ld): entered.\n", __func__, vha->host_no));

Expand Down
6 changes: 2 additions & 4 deletions drivers/scsi/qla2xxx/qla_os.c
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,6 @@ qla2x00_get_new_sp(scsi_qla_host_t *vha, fc_port_t *fcport,

sp->fcport = fcport;
sp->cmd = cmd;
sp->que = ha->req_q_map[0];
sp->flags = 0;
CMD_SP(cmd) = (void *)sp;
cmd->scsi_done = done;
Expand Down Expand Up @@ -742,7 +741,7 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
unsigned long flags;
int wait = 0;
struct qla_hw_data *ha = vha->hw;
struct req_que *req;
struct req_que *req = vha->req;
srb_t *spt;

qla2x00_block_error_handler(cmd);
Expand All @@ -758,7 +757,6 @@ qla2xxx_eh_abort(struct scsi_cmnd *cmd)
spt = (srb_t *) CMD_SP(cmd);
if (!spt)
return SUCCESS;
req = spt->que;

/* Check active list for command command. */
spin_lock_irqsave(&ha->hardware_lock, flags);
Expand Down Expand Up @@ -826,7 +824,7 @@ qla2x00_eh_wait_for_pending_commands(scsi_qla_host_t *vha, unsigned int t,
return status;

spin_lock_irqsave(&ha->hardware_lock, flags);
req = sp->que;
req = vha->req;
for (cnt = 1; status == QLA_SUCCESS &&
cnt < MAX_OUTSTANDING_COMMANDS; cnt++) {
sp = req->outstanding_cmds[cnt];
Expand Down

0 comments on commit 67c2e93

Please sign in to comment.