Commit e5130849 authored by Andrew Vasquez's avatar Andrew Vasquez Committed by James Bottomley

[PATCH] [1/18] qla2xxx: Add wmb() to critical paths

  Add memory barriers to ensure that all load operations have
  completed before the (MMIO) write to the ISP's registers.
Signed-off-by: default avatarAndrew Vasquez <andrew.vasquez@qlogic.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@SteelEye.com>
parent 03339dd1
......@@ -481,6 +481,7 @@ qla2x00_start_scsi(srb_t *sp)
/* Set total data segment count. */
cmd_pkt->entry_count = (uint8_t)sp->req_cnt;
wmb();
/* Adjust ring index. */
ha->req_ring_index++;
......@@ -541,6 +542,7 @@ __qla2x00_marker(scsi_qla_host_t *ha, uint16_t loop_id, uint16_t lun,
pkt->lun = cpu_to_le16(lun);
SET_TARGET_ID(ha, pkt->target, loop_id);
}
wmb();
/* Issue command to ISP */
qla2x00_isp_cmd(ha);
......
......@@ -438,6 +438,7 @@ qla2x00_send_abort_iocb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
cpu_to_le16(iodesc->remote_fcport->loop_id);
mbxentry->mb2 = LSW(handle_to_abort);
mbxentry->mb3 = MSW(handle_to_abort);
wmb();
qla2x00_add_iodesc_timer(iodesc);
......@@ -514,6 +515,7 @@ qla2x00_send_adisc_iocb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
mbxentry->mb6 = cpu_to_le16(MSW(MSD(ha->iodesc_pd_dma)));
mbxentry->mb7 = cpu_to_le16(LSW(MSD(ha->iodesc_pd_dma)));
mbxentry->mb10 = __constant_cpu_to_le16(BIT_0);
wmb();
qla2x00_add_iodesc_timer(iodesc);
......@@ -625,6 +627,7 @@ qla2x00_send_logout_iocb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
mbxentry->mb0 = __constant_cpu_to_le16(MBC_LOGOUT_FABRIC_PORT);
mbxentry->mb1 = mbxentry->loop_id.extended =
cpu_to_le16(iodesc->remote_fcport->loop_id);
wmb();
qla2x00_add_iodesc_timer(iodesc);
......@@ -702,6 +705,7 @@ qla2x00_send_login_iocb(scsi_qla_host_t *ha, struct io_descriptor *iodesc,
mbxentry->mb2 = cpu_to_le16(d_id->b.domain);
mbxentry->mb3 = cpu_to_le16(d_id->b.area << 8 | d_id->b.al_pa);
mbxentry->mb10 = __constant_cpu_to_le16(BIT_0);
wmb();
qla2x00_add_iodesc_timer(iodesc);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment