diff options
author | Andrew Vasquez <andrewv@marvell.com> | 2019-03-26 00:38:40 -0700 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2019-03-27 21:54:52 -0400 |
commit | 90ccf7579873f498ea1254c12044477056692432 (patch) | |
tree | 2308bb275db0097cfa392a821c117cfc92431573 /drivers/scsi/qedf | |
parent | 96b1765a099b3b38d5a77796c45ee11a6ea6bf84 (diff) |
scsi: qedf: Correct the memory barriers in qedf_ring_doorbell
- Correct memory barriers to make sure all cmnds are flushed.
Signed-off-by: Andrew Vasquez <andrewv@marvell.com>
Signed-off-by: Saurav Kashyap <skashyap@marvell.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/qedf')
-rw-r--r-- | drivers/scsi/qedf/qedf_io.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/scsi/qedf/qedf_io.c b/drivers/scsi/qedf/qedf_io.c index 58257ecfaf08..ab6705660e67 100644 --- a/drivers/scsi/qedf/qedf_io.c +++ b/drivers/scsi/qedf/qedf_io.c @@ -773,10 +773,18 @@ void qedf_ring_doorbell(struct qedf_rport *fcport) FCOE_DB_DATA_AGG_VAL_SEL_SHIFT; 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); - /* 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(); - mmiowb(); } static void qedf_trace_io(struct qedf_rport *fcport, struct qedf_ioreq *io_req, |