diff options
author | Quinn Tran <quinn.tran@cavium.com> | 2018-09-04 14:19:15 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-09-11 20:28:08 -0400 |
commit | 6a6294689201e6c0c4a78fb800b5c248fc887de6 (patch) | |
tree | 23f504edf23014e2c699776bbda95d59f52ce676 /drivers/scsi/qla2xxx/qla_iocb.c | |
parent | 8b4673ba3a1b992b757a32667d2d3adae80e11fd (diff) | |
download | lwn-6a6294689201e6c0c4a78fb800b5c248fc887de6.tar.gz lwn-6a6294689201e6c0c4a78fb800b5c248fc887de6.zip |
scsi: qla2xxx: Move {get|rel}_sp to base_qpair struct
Currently, qla2x00_[get_sp|rel_sp] routines does {get|release} of srb
resource/srb_mempool directly from qla_hw_data. qla2x00_start_sp() is used to
issue management commands through the default Request Q 0 & Response Q 0 or
base_qpair. This patch moves access of these resources through
base_qpair. Instead of having knowledge of specific Q number and lock to
rsp/req queue, this change will key off the qpair that is assigned to the srb
resource. This lays the ground work for other routines to see this resource
through the qpair.
Signed-off-by: Quinn Tran <quinn.tran@cavium.com>
Signed-off-by: Himanshu Madhani <himanshu.madhani@cavium.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qla2xxx/qla_iocb.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_iocb.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/scsi/qla2xxx/qla_iocb.c b/drivers/scsi/qla2xxx/qla_iocb.c index c699bbb8485b..6335b8ce5fbd 100644 --- a/drivers/scsi/qla2xxx/qla_iocb.c +++ b/drivers/scsi/qla2xxx/qla_iocb.c @@ -3440,12 +3440,13 @@ qla2x00_start_sp(srb_t *sp) int rval; scsi_qla_host_t *vha = sp->vha; struct qla_hw_data *ha = vha->hw; + struct qla_qpair *qp = sp->qpair; void *pkt; unsigned long flags; rval = QLA_FUNCTION_FAILED; - spin_lock_irqsave(&ha->hardware_lock, flags); - pkt = qla2x00_alloc_iocbs(vha, sp); + spin_lock_irqsave(qp->qp_lock_ptr, flags); + pkt = __qla2x00_alloc_iocbs(sp->qpair, sp); if (!pkt) { ql_log(ql_log_warn, vha, 0x700c, "qla2x00_alloc_iocbs failed.\n"); @@ -3523,9 +3524,9 @@ qla2x00_start_sp(srb_t *sp) } wmb(); - qla2x00_start_iocbs(vha, ha->req_q_map[0]); + qla2x00_start_iocbs(vha, qp->req); done: - spin_unlock_irqrestore(&ha->hardware_lock, flags); + spin_unlock_irqrestore(qp->qp_lock_ptr, flags); return rval; } |