mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-06-29 18:11:20 +00:00
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>
This commit is contained in:
parent
b560f03ddf
commit
34c7bb4705
1 changed files with 3 additions and 7 deletions
|
@ -213,19 +213,15 @@ static int qed_spq_hw_post(struct qed_hwfn *p_hwfn,
|
||||||
SET_FIELD(db.params, CORE_DB_DATA_AGG_VAL_SEL,
|
SET_FIELD(db.params, CORE_DB_DATA_AGG_VAL_SEL,
|
||||||
DQ_XCM_CORE_SPQ_PROD_CMD);
|
DQ_XCM_CORE_SPQ_PROD_CMD);
|
||||||
db.agg_flags = DQ_XCM_CORE_DQ_CF_CMD;
|
db.agg_flags = DQ_XCM_CORE_DQ_CF_CMD;
|
||||||
|
|
||||||
/* validate producer is up to-date */
|
|
||||||
rmb();
|
|
||||||
|
|
||||||
db.spq_prod = cpu_to_le16(qed_chain_get_prod_idx(p_chain));
|
db.spq_prod = cpu_to_le16(qed_chain_get_prod_idx(p_chain));
|
||||||
|
|
||||||
/* do not reorder */
|
/* make sure the SPQE is updated before the doorbell */
|
||||||
barrier();
|
wmb();
|
||||||
|
|
||||||
DOORBELL(p_hwfn, qed_db_addr(p_spq->cid, DQ_DEMS_LEGACY), *(u32 *)&db);
|
DOORBELL(p_hwfn, qed_db_addr(p_spq->cid, DQ_DEMS_LEGACY), *(u32 *)&db);
|
||||||
|
|
||||||
/* make sure doorbell is rang */
|
/* make sure doorbell is rang */
|
||||||
mmiowb();
|
wmb();
|
||||||
|
|
||||||
DP_VERBOSE(p_hwfn, QED_MSG_SPQ,
|
DP_VERBOSE(p_hwfn, QED_MSG_SPQ,
|
||||||
"Doorbelled [0x%08x, CID 0x%08x] with Flags: %02x agg_params: %02x, prod: %04x\n",
|
"Doorbelled [0x%08x, CID 0x%08x] with Flags: %02x agg_params: %02x, prod: %04x\n",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue