diff options
author | Sawan Chandak <sawan.chandak@cavium.com> | 2017-06-13 20:47:19 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2017-06-27 21:21:40 -0400 |
commit | d65237c7f086042b5630d94fe2d151f62c09f723 (patch) | |
tree | b9a52b70191cb79251c3c42230003964f9ade519 /drivers/scsi/qla2xxx/qla_init.c | |
parent | e326d22af9653dd8eff05d71f0d1bad9174578a3 (diff) | |
download | op-kernel-dev-d65237c7f086042b5630d94fe2d151f62c09f723.zip op-kernel-dev-d65237c7f086042b5630d94fe2d151f62c09f723.tar.gz |
scsi: qla2xxx: Fix mailbox failure while deleting Queue pairs
In target mode driver, queue pairs are not created during driver load
time, instead they are created at the configuration time after chip
reset. If a user tries to load/unload driver after queue pairs are
created, then there would be mailbox failure, while deleting queue
pairs. Flag is added to check if queue pairs are created or not. Queue
pairs will be deleted only If they were created during target
configuration.
Signed-off-by: Sawan Chandak <sawan.chandak@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_init.c')
-rw-r--r-- | drivers/scsi/qla2xxx/qla_init.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 4366b12..6230f33 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -7719,9 +7719,12 @@ fail_qid_map: int qla2xxx_delete_qpair(struct scsi_qla_host *vha, struct qla_qpair *qpair) { - int ret; + int ret = QLA_FUNCTION_FAILED; struct qla_hw_data *ha = qpair->hw; + if (!vha->flags.qpairs_req_created && !vha->flags.qpairs_rsp_created) + goto fail; + qpair->delete_in_progress = 1; while (atomic_read(&qpair->ref_count)) msleep(500); @@ -7738,8 +7741,11 @@ int qla2xxx_delete_qpair(struct scsi_qla_host *vha, struct qla_qpair *qpair) clear_bit(qpair->id, ha->qpair_qid_map); ha->num_qpairs--; list_del(&qpair->qp_list_elem); - if (list_empty(&vha->qp_list)) + if (list_empty(&vha->qp_list)) { vha->flags.qpairs_available = 0; + vha->flags.qpairs_req_created = 0; + vha->flags.qpairs_rsp_created = 0; + } mempool_destroy(qpair->srb_mempool); kfree(qpair); mutex_unlock(&ha->mq_lock); |