diff options
author | Sudarsana Reddy Kalluru <sudarsana.kalluru@qlogic.com> | 2016-06-28 07:46:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-06-29 08:12:45 -0400 |
commit | 34c7bb4705a0a2d344b0c82eaf3d3bfa2bc9da45 (patch) | |
tree | 8ca04fdbb5fa7ee021f95e5d7250eb79b6193d77 | |
parent | b560f03ddfb072bca65e9440ff0dc4f9b1d1f056 (diff) |
qed: Protect the doorbell BAR with the write barriers.
SPQ doorbell is currently protected with the compilation barrier. Under the
stress scenarios, we may get into a state where (due to the weak ordering)
several ramrod doorbells were written to the BAR with an out-of-order
producer values. Need to change the barrier type to a write barrier to make
sure that the write buffer is flushed after each doorbell.
Signed-off-by: Sudarsana Reddy Kalluru <sudarsana.kalluru@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/qlogic/qed/qed_spq.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/drivers/net/ethernet/qlogic/qed/qed_spq.c b/drivers/net/ethernet/qlogic/qed/qed_spq.c index 67d9893774d8..b122f6013b6c 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_spq.c +++ b/drivers/net/ethernet/qlogic/qed/qed_spq.c | |||
@@ -213,19 +213,15 @@ static int qed_spq_hw_post(struct qed_hwfn *p_hwfn, | |||
213 | SET_FIELD(db.params, CORE_DB_DATA_AGG_VAL_SEL, | 213 | SET_FIELD(db.params, CORE_DB_DATA_AGG_VAL_SEL, |
214 | DQ_XCM_CORE_SPQ_PROD_CMD); | 214 | DQ_XCM_CORE_SPQ_PROD_CMD); |
215 | db.agg_flags = DQ_XCM_CORE_DQ_CF_CMD; | 215 | db.agg_flags = DQ_XCM_CORE_DQ_CF_CMD; |
216 | |||
217 | /* validate producer is up to-date */ | ||
218 | rmb(); | ||
219 | |||
220 | db.spq_prod = cpu_to_le16(qed_chain_get_prod_idx(p_chain)); | 216 | db.spq_prod = cpu_to_le16(qed_chain_get_prod_idx(p_chain)); |
221 | 217 | ||
222 | /* do not reorder */ | 218 | /* make sure the SPQE is updated before the doorbell */ |
223 | barrier(); | 219 | wmb(); |
224 | 220 | ||
225 | DOORBELL(p_hwfn, qed_db_addr(p_spq->cid, DQ_DEMS_LEGACY), *(u32 *)&db); | 221 | DOORBELL(p_hwfn, qed_db_addr(p_spq->cid, DQ_DEMS_LEGACY), *(u32 *)&db); |
226 | 222 | ||
227 | /* make sure doorbell is rang */ | 223 | /* make sure doorbell is rang */ |
228 | mmiowb(); | 224 | wmb(); |
229 | 225 | ||
230 | DP_VERBOSE(p_hwfn, QED_MSG_SPQ, | 226 | DP_VERBOSE(p_hwfn, QED_MSG_SPQ, |
231 | "Doorbelled [0x%08x, CID 0x%08x] with Flags: %02x agg_params: %02x, prod: %04x\n", | 227 | "Doorbelled [0x%08x, CID 0x%08x] with Flags: %02x agg_params: %02x, prod: %04x\n", |