Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc
[pandora-kernel.git] / drivers / scsi / qla2xxx / qla_mid.c
index 3f23932..51716c7 100644 (file)
@@ -69,9 +69,10 @@ static scsi_qla_host_t *
 qla24xx_find_vhost_by_name(struct qla_hw_data *ha, uint8_t *port_name)
 {
        scsi_qla_host_t *vha;
+       struct scsi_qla_host *tvha;
 
        /* Locate matching device in database. */
-       list_for_each_entry(vha, &ha->vp_list, list) {
+       list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) {
                if (!memcmp(port_name, vha->port_name, WWN_SIZE))
                        return vha;
        }
@@ -194,11 +195,11 @@ qla24xx_configure_vp(scsi_qla_host_t *vha)
 void
 qla2x00_alert_all_vps(struct rsp_que *rsp, uint16_t *mb)
 {
-       scsi_qla_host_t *vha;
+       scsi_qla_host_t *vha, *tvha;
        struct qla_hw_data *ha = rsp->hw;
        int i = 0;
 
-       list_for_each_entry(vha, &ha->vp_list, list) {
+       list_for_each_entry_safe(vha, tvha, &ha->vp_list, list) {
                if (vha->vp_idx) {
                        switch (mb[0]) {
                        case MBA_LIP_OCCURRED:
@@ -300,6 +301,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha)
        int ret;
        struct qla_hw_data *ha = vha->hw;
        scsi_qla_host_t *vp;
+       struct scsi_qla_host *tvp;
 
        if (vha->vp_idx)
                return;
@@ -308,7 +310,7 @@ qla2x00_do_dpc_all_vps(scsi_qla_host_t *vha)
 
        clear_bit(VP_DPC_NEEDED, &vha->dpc_flags);
 
-       list_for_each_entry(vp, &ha->vp_list, list) {
+       list_for_each_entry_safe(vp, tvp, &ha->vp_list, list) {
                if (vp->vp_idx)
                        ret = qla2x00_do_dpc_vp(vp);
        }
@@ -357,7 +359,7 @@ qla24xx_create_vhost(struct fc_vport *fc_vport)
        scsi_qla_host_t *base_vha = shost_priv(fc_vport->shost);
        struct qla_hw_data *ha = base_vha->hw;
        scsi_qla_host_t *vha;
-       struct scsi_host_template *sht = &qla24xx_driver_template;
+       struct scsi_host_template *sht = &qla2xxx_driver_template;
        struct Scsi_Host *host;
 
        vha = qla2x00_create_host(sht, ha);
@@ -582,6 +584,7 @@ qla25xx_create_req_que(struct qla_hw_data *ha, uint16_t options,
        struct req_que *req = NULL;
        struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
        uint16_t que_id = 0;
+       device_reg_t __iomem *reg;
 
        req = kzalloc(sizeof(struct req_que), GFP_KERNEL);
        if (req == NULL) {
@@ -629,6 +632,9 @@ qla25xx_create_req_que(struct qla_hw_data *ha, uint16_t options,
        req->ring_index = 0;
        req->cnt = req->length;
        req->id = que_id;
+       reg = ISP_QUE_REG(ha, que_id);
+       req->req_q_in = &reg->isp25mq.req_q_in;
+       req->req_q_out = &reg->isp25mq.req_q_out;
        req->max_q_depth = ha->req_q_map[0]->max_q_depth;
        mutex_unlock(&ha->vport_lock);
 
@@ -656,7 +662,8 @@ qla25xx_create_rsp_que(struct qla_hw_data *ha, uint16_t options,
        int ret = 0;
        struct rsp_que *rsp = NULL;
        struct scsi_qla_host *base_vha = pci_get_drvdata(ha->pdev);
-       uint16_t que_id = 0;;
+       uint16_t que_id = 0;
+       device_reg_t __iomem *reg;
 
        rsp = kzalloc(sizeof(struct rsp_que), GFP_KERNEL);
        if (rsp == NULL) {
@@ -704,6 +711,9 @@ qla25xx_create_rsp_que(struct qla_hw_data *ha, uint16_t options,
        rsp->ring_ptr = rsp->ring;
        rsp->ring_index = 0;
        rsp->id = que_id;
+       reg = ISP_QUE_REG(ha, que_id);
+       rsp->rsp_q_in = &reg->isp25mq.rsp_q_in;
+       rsp->rsp_q_out = &reg->isp25mq.rsp_q_out;
        mutex_unlock(&ha->vport_lock);
 
        ret = qla25xx_request_irq(rsp);