From patchwork Mon Feb 9 19:11:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Malcolm Priestley X-Patchwork-Id: 5802821 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id B3DF89F30C for ; Mon, 9 Feb 2015 19:12:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D6C2F2010B for ; Mon, 9 Feb 2015 19:12:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ECE3D20109 for ; Mon, 9 Feb 2015 19:12:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933404AbbBITMe (ORCPT ); Mon, 9 Feb 2015 14:12:34 -0500 Received: from mail-wi0-f194.google.com ([209.85.212.194]:48640 "EHLO mail-wi0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933111AbbBITMe (ORCPT ); Mon, 9 Feb 2015 14:12:34 -0500 Received: by mail-wi0-f194.google.com with SMTP id hm9so2840742wib.1 for ; Mon, 09 Feb 2015 11:12:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=oYk4pagkaDLIoFImPkexHj7IxW2fB9mdsEY6+tP1LS4=; b=MN9+rAhqlmHhpZMsx6gicd3BFVMpxaNatLAfjWx3pW75V7n/a+0oMpS5eDgIWZeUPn xFEaBtMCv5rUXxllcesOb7rfspajRGjSG1tvS6KKCRTRxNOcJREJmELWMBibNQ8QJrxN 213z1OjzIPK/pvxOrQc4OH2rtChmS1Shk8n+jchYZydi6OjQV8A9xtrSirypH+b7pFF3 Wiuhs1hi/v95Hu30eEfzoOXiuV+J6uXyxU7l1QvKhMCvaP/bM266XHpCEyDomtkYZ+S2 zZMH1Ek28lqjKLei2jejwVv0HyEnLArZ0ceVuOwOU8ADdAZn1GEiqDwjZVHae+UHNdkG Uhkw== X-Received: by 10.194.110.69 with SMTP id hy5mr46104224wjb.121.1423509153148; Mon, 09 Feb 2015 11:12:33 -0800 (PST) Received: from tipsey.3.home ([188.29.105.195]) by mx.google.com with ESMTPSA id hn2sm17598545wjc.5.2015.02.09.11.12.27 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 09 Feb 2015 11:12:32 -0800 (PST) From: Malcolm Priestley To: gregkh@linuxfoundation.org Cc: linux-wireless@vger.kernel.org, devel@linuxdriverproject.org, Malcolm Priestley Subject: [PATCH fix for v3.20] staging: vt6655: vnt_tx_packet fix dma_idx selection. Date: Mon, 9 Feb 2015 19:11:33 +0000 Message-Id: <1423509094-4548-1-git-send-email-tvboxspy@gmail.com> X-Mailer: git-send-email 2.1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is still a problem that dma_idx is causing packets to go onto the wrong tx path. Protect dma_idx fully with the present first lock and use pTDInfo->byFlags TD_FLAGS_NETIF_SKB to set MACvTransmit. Signed-off-by: Malcolm Priestley --- drivers/staging/vt6655/device_main.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/drivers/staging/vt6655/device_main.c b/drivers/staging/vt6655/device_main.c index 4324282..f5c5872 100644 --- a/drivers/staging/vt6655/device_main.c +++ b/drivers/staging/vt6655/device_main.c @@ -1187,12 +1187,14 @@ static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) { struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data; PSTxDesc head_td; - u32 dma_idx = TYPE_AC0DMA; + u32 dma_idx; unsigned long flags; spin_lock_irqsave(&priv->lock, flags); - if (!ieee80211_is_data(hdr->frame_control)) + if (ieee80211_is_data(hdr->frame_control)) + dma_idx = TYPE_AC0DMA; + else dma_idx = TYPE_TXDMA0; if (AVAIL_TD(priv, dma_idx) < 1) { @@ -1206,6 +1208,9 @@ static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) head_td->pTDInfo->skb = skb; + if (dma_idx == TYPE_AC0DMA) + head_td->pTDInfo->byFlags = TD_FLAGS_NETIF_SKB; + priv->iTDUsed[dma_idx]++; /* Take ownership */ @@ -1234,13 +1239,10 @@ static int vnt_tx_packet(struct vnt_private *priv, struct sk_buff *skb) head_td->buff_addr = cpu_to_le32(head_td->pTDInfo->skb_dma); - if (dma_idx == TYPE_AC0DMA) { - head_td->pTDInfo->byFlags = TD_FLAGS_NETIF_SKB; - + if (head_td->pTDInfo->byFlags & TD_FLAGS_NETIF_SKB) MACvTransmitAC0(priv->PortOffset); - } else { + else MACvTransmit0(priv->PortOffset); - } spin_unlock_irqrestore(&priv->lock, flags);