]> git.baikalelectronics.ru Git - kernel.git/commitdiff
qed: Fix qed_ll2_post_rx_buffer_notify_fw() by adding a write memory barrier
authorDenis Bolotin <dbolotin@marvell.com>
Thu, 3 Jan 2019 10:02:40 +0000 (12:02 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 4 Jan 2019 20:57:30 +0000 (12:57 -0800)
Make sure chain element is updated before ringing the doorbell.

Signed-off-by: Denis Bolotin <dbolotin@marvell.com>
Signed-off-by: Ariel Elior <aelior@marvell.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qed/qed_ll2.c

index 90afd514ffe18351aee5da16560a549cadf5d06e..d9237c65a83880b25653d1881080e00b54ea371d 100644 (file)
@@ -1619,6 +1619,10 @@ static void qed_ll2_post_rx_buffer_notify_fw(struct qed_hwfn *p_hwfn,
        cq_prod = qed_chain_get_prod_idx(&p_rx->rcq_chain);
        rx_prod.bd_prod = cpu_to_le16(bd_prod);
        rx_prod.cqe_prod = cpu_to_le16(cq_prod);
+
+       /* Make sure chain element is updated before ringing the doorbell */
+       dma_wmb();
+
        DIRECT_REG_WR(p_rx->set_prod_addr, *((u32 *)&rx_prod));
 }