From patchwork Wed Jul 16 13:41:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 4567251 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C4CE1C0514 for ; Wed, 16 Jul 2014 13:51:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D8656201BA for ; Wed, 16 Jul 2014 13:51:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DC56E201B4 for ; Wed, 16 Jul 2014 13:51:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964926AbaGPNvs (ORCPT ); Wed, 16 Jul 2014 09:51:48 -0400 Received: from mail-wg0-f49.google.com ([74.125.82.49]:33650 "EHLO mail-wg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934406AbaGPNuD (ORCPT ); Wed, 16 Jul 2014 09:50:03 -0400 Received: by mail-wg0-f49.google.com with SMTP id k14so907261wgh.20 for ; Wed, 16 Jul 2014 06:49:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=s0xSsfSu6je7sM58KmzRK2dl4CkKMHJoA4bmgSyPAyc=; b=vQx1DB7SQ1mD7AOoAFXwzsdxpAMySYH4eHFAa7/o+OSkD7psm8ATdIcxME74W8D/C7 feSc17tMx/Cpmn/aWU4tKiqBQ5+mbqiPAmHsJyDxQ9bSFihCWQmW8EOsL5UhiqVA3tAh K0hS+7C27DI1rq0QVfVi3Nv0OCvVtLTcUPGJs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=s0xSsfSu6je7sM58KmzRK2dl4CkKMHJoA4bmgSyPAyc=; b=VLLUk1zgifpSNXMPztbcGBSB1iQSD7sP+DKUmrmzXjNNobOCLz70Wv3fg0HUePpJDE SELJ1vV/ESYTSmiFlHDETm6d+UaW2DNfLjoGebkY52+sAPZL+/WL0Dj0YfG2JY6Efm8g CaHQXzbh+hGTg4ZzoFgecL4rfpaI13e8ugIMxWol+YcI43w+rkoO+ZpUxwUhTzUORxvp KKpo+FhyFJJ5ijWBwUqF0gQ/XNdsDXMZqwBoAmyU/XxrRv4cc4HqpkmVBGqvXiXWpaer rzXBmZ6R1U8K+GyxynJAzEzjZbW0iV3y0EBixeLqgb+escQYMEGycRLfyAWV7cSZdr2J /rJw== X-Gm-Message-State: ALoCoQmgXeA7wlYUIbiGDzmLYV1s/6XzhG2y0S/Tn6YB2/umabWNBF4U3mRT6Ex7QzUiGbWFf62/plr9px17M9L8ZnVexjX4c1uHlsfdpMFO9jbG3cRLjMQ= X-Received: by 10.180.81.234 with SMTP id d10mr13987665wiy.79.1405518595504; Wed, 16 Jul 2014 06:49:55 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id cj8sm39926380wjb.5.2014.07.16.06.49.54 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Jul 2014 06:49:54 -0700 (PDT) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Ben Greear , Michal Kazior Subject: [PATCH] ath10k: prevent some tx flushing failures Date: Wed, 16 Jul 2014 15:41:13 +0200 Message-Id: <1405518073-14513-1-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 X-DomainID: tieto.com 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_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Firmware could request inspection of some submitted tx requests. Since the callback wasn't implemented it was possible to bleed tx msdu_ids which could translate to tx flushing timeouts. There's nothing ath10k can do to help firmware with tx processing now so just report all tx frames as already inspected to prevent firmware from sending up inspection events and force it to report regular tx completion indications with discard status. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/htt_rx.c | 7 +++++++ drivers/net/wireless/ath/ath10k/htt_tx.c | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/drivers/net/wireless/ath/ath10k/htt_rx.c b/drivers/net/wireless/ath/ath10k/htt_rx.c index eebc860..318efc3 100644 --- a/drivers/net/wireless/ath/ath10k/htt_rx.c +++ b/drivers/net/wireless/ath/ath10k/htt_rx.c @@ -1516,6 +1516,13 @@ void ath10k_htt_t2h_msg_handler(struct ath10k *ar, struct sk_buff *skb) trace_ath10k_htt_stats(skb->data, skb->len); break; case HTT_T2H_MSG_TYPE_TX_INSPECT_IND: + /* Firmware can return tx frames if it's unable to fully + * process them and suspects host may be able to fix it. ath10k + * sends all tx frames as already inspected so this shouldn't + * happen unless fw has a bug. + */ + ath10k_warn("received an unexpected htt tx inspect event\n"); + break; case HTT_T2H_MSG_TYPE_RX_ADDBA: case HTT_T2H_MSG_TYPE_RX_DELBA: case HTT_T2H_MSG_TYPE_RX_FLUSH: diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index accb6b4..8b27bfc 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -531,6 +531,12 @@ int ath10k_htt_tx(struct ath10k_htt *htt, struct sk_buff *msdu) flags1 |= HTT_DATA_TX_DESC_FLAGS1_CKSUM_L3_OFFLOAD; flags1 |= HTT_DATA_TX_DESC_FLAGS1_CKSUM_L4_OFFLOAD; + /* Prevent firmware from sending up tx inspection requests. There's + * nothing ath10k can do with frames requested for inspection so force + * it to simply rely a regular tx completion with discard status. + */ + flags1 |= HTT_DATA_TX_DESC_FLAGS1_POSTPONED; + skb_cb->htt.txbuf->cmd_hdr.msg_type = HTT_H2T_MSG_TYPE_TX_FRM; skb_cb->htt.txbuf->cmd_tx.flags0 = flags0; skb_cb->htt.txbuf->cmd_tx.flags1 = __cpu_to_le16(flags1);