From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:49649 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751986AbbFCBud (ORCPT ); Tue, 2 Jun 2015 21:50:33 -0400 Subject: Patch "staging: vt6655: vnt_tx_packet Correct TX order of OWNED_BY_NIC" has been added to the 4.0-stable tree To: tvboxspy@gmail.com, gregkh@linuxfoundation.org Cc: , From: Date: Wed, 03 Jun 2015 10:50:21 +0900 Message-ID: <143329622125118@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled staging: vt6655: vnt_tx_packet Correct TX order of OWNED_BY_NIC to the 4.0-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: staging-vt6655-vnt_tx_packet-correct-tx-order-of-owned_by_nic.patch and it can be found in the queue-4.0 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From d65d2b25d2761153390df8026cca1a528d9b6c5a Mon Sep 17 00:00:00 2001 From: Malcolm Priestley Date: Tue, 21 Apr 2015 22:33:00 +0100 Subject: staging: vt6655: vnt_tx_packet Correct TX order of OWNED_BY_NIC From: Malcolm Priestley commit d65d2b25d2761153390df8026cca1a528d9b6c5a upstream. The state of m_td0TD0.f1Owner should change after the buff_addr has been filled otherwise the device grabs the buffer too early. m_td0TD0.f1Owner is protected by memory barriers on both sides of change. iTDUsed is best incremented after MACvTransmit. It appears that f1Owner actually polls to do the memory transfer. A back port patch will be needed for v3.19 Signed-off-by: Malcolm Priestley Signed-off-by: Greg Kroah-Hartman --- drivers/staging/vt6655/device_main.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -1203,14 +1203,6 @@ static int vnt_tx_packet(struct vnt_priv if (dma_idx == TYPE_AC0DMA) head_td->pTDInfo->byFlags = TD_FLAGS_NETIF_SKB; - priv->iTDUsed[dma_idx]++; - - /* Take ownership */ - wmb(); - head_td->m_td0TD0.f1Owner = OWNED_BY_NIC; - - /* get Next */ - wmb(); priv->apCurrTD[dma_idx] = head_td->next; spin_unlock_irqrestore(&priv->lock, flags); @@ -1231,11 +1223,18 @@ static int vnt_tx_packet(struct vnt_priv head_td->buff_addr = cpu_to_le32(head_td->pTDInfo->skb_dma); + /* Poll Transmit the adapter */ + wmb(); + head_td->m_td0TD0.f1Owner = OWNED_BY_NIC; + wmb(); /* second memory barrier */ + if (head_td->pTDInfo->byFlags & TD_FLAGS_NETIF_SKB) MACvTransmitAC0(priv->PortOffset); else MACvTransmit0(priv->PortOffset); + priv->iTDUsed[dma_idx]++; + spin_unlock_irqrestore(&priv->lock, flags); return 0; Patches currently in stable-queue which might be from tvboxspy@gmail.com are queue-4.0/staging-vt6655-vnt_tx_packet-correct-tx-order-of-owned_by_nic.patch queue-4.0/staging-vt6655-device_free_tx_buf-use-only-ieee80211_tx_status_irqsafe.patch queue-4.0/staging-vt6656-use-ieee80211_tx_info-to-select-packet-type.patch queue-4.0/staging-vt6655-implement-ieee80211_tx_stat_noack_transmitted.patch queue-4.0/staging-vt6655-fix-80211-control-and-management-status-reporting.patch queue-4.0/staging-vt6655-lock-macvwritebssidaddress.patch