From: Michael Chan Date: Mon, 6 Jun 2016 06:37:14 +0000 (-0400) Subject: bnxt_en: Fix tx push race condition. X-Git-Tag: v4.1.12-92~126^2~16 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=993d46d491a92c44080b098d35431b55061ce2c7;p=users%2Fjedix%2Flinux-maple.git bnxt_en: Fix tx push race condition. Orabug: 23221795 Set the is_push flag in the software BD before the tx data is pushed to the chip. It is possible to get the tx interrupt as soon as the tx data is pushed. The tx handler will not handle the event properly if the is_push flag is not set and it will crash. Signed-off-by: Michael Chan Signed-off-by: David S. Miller (cherry picked from commit b9a8460a08a1e0150073cda3e7a0dd23cb888052) Signed-off-by: Brian Maly --- diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c index 99be94d4c6e3..f89090393fda 100644 --- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c +++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c @@ -289,7 +289,9 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev) cpu_to_le32(DB_KEY_TX_PUSH | DB_LONG_TX_PUSH | prod); txr->tx_prod = prod; + tx_buf->is_push = 1; netdev_tx_sent_queue(txq, skb->len); + wmb(); /* Sync is_push and byte queue before pushing data */ push_len = (length + sizeof(*tx_push) + 7) / 8; if (push_len > 16) { @@ -301,7 +303,6 @@ static netdev_tx_t bnxt_start_xmit(struct sk_buff *skb, struct net_device *dev) push_len); } - tx_buf->is_push = 1; goto tx_done; }