Commit 90ccf757 authored by Andrew Vasquez's avatar Andrew Vasquez Committed by Martin K. Petersen

scsi: qedf: Correct the memory barriers in qedf_ring_doorbell

 - Correct memory barriers to make sure all cmnds are flushed.
Signed-off-by: default avatarAndrew Vasquez <andrewv@marvell.com>
Signed-off-by: default avatarSaurav Kashyap <skashyap@marvell.com>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
parent 96b1765a
...@@ -773,10 +773,18 @@ void qedf_ring_doorbell(struct qedf_rport *fcport) ...@@ -773,10 +773,18 @@ void qedf_ring_doorbell(struct qedf_rport *fcport)
FCOE_DB_DATA_AGG_VAL_SEL_SHIFT; FCOE_DB_DATA_AGG_VAL_SEL_SHIFT;
dbell.sq_prod = fcport->fw_sq_prod_idx; dbell.sq_prod = fcport->fw_sq_prod_idx;
/* wmb makes sure that the BDs data is updated before updating the
* producer, otherwise FW may read old data from the BDs.
*/
wmb();
barrier();
writel(*(u32 *)&dbell, fcport->p_doorbell); writel(*(u32 *)&dbell, fcport->p_doorbell);
/* Make sure SQ index is updated so f/w prcesses requests in order */ /*
* Fence required to flush the write combined buffer, since another
* CPU may write to the same doorbell address and data may be lost
* due to relaxed order nature of write combined bar.
*/
wmb(); wmb();
mmiowb();
} }
static void qedf_trace_io(struct qedf_rport *fcport, struct qedf_ioreq *io_req, static void qedf_trace_io(struct qedf_rport *fcport, struct qedf_ioreq *io_req,
......
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