From patchwork Tue Oct 15 17:29:56 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 3046801 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 7FBBB9F432 for ; Tue, 15 Oct 2013 17:32:48 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6A9E120435 for ; Tue, 15 Oct 2013 17:32:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 917B020445 for ; Tue, 15 Oct 2013 17:32:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933504Ab3JORcl (ORCPT ); Tue, 15 Oct 2013 13:32:41 -0400 Received: from mail-pb0-f42.google.com ([209.85.160.42]:55556 "EHLO mail-pb0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933496Ab3JORcj (ORCPT ); Tue, 15 Oct 2013 13:32:39 -0400 Received: by mail-pb0-f42.google.com with SMTP id un15so9132717pbc.1 for ; Tue, 15 Oct 2013 10:32:39 -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:in-reply-to:references; bh=edROQLMdrJ3+nq1Rja3SsOeXcc3fzAxWbOSog8Dt/is=; b=DXeOhPbhK5242pGJHr53V9pKgxmy5BCLkv3ot6FHbtpoBc6uttQtWbj6WMQho36k+X wOd/Zwprl+tr8Rht9f2wZp5eF8MJdQdxQvlyJxy4aMro7QE3nqhvbRFeg6O2pYCqD98S 8KmrOm9cEPK+2IHp9nx/UiPrLFPS1AZJAGTpI= 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:in-reply-to :references; bh=edROQLMdrJ3+nq1Rja3SsOeXcc3fzAxWbOSog8Dt/is=; b=WMt8Yeasr6B8GkENjmUb5vxRDz9iQjz7U9whi6rlvA30+laacjlDEA9+sGJqrOlbD/ z2BAOI3hkrgJH6seo4TMlXSLYySD6GUXQi1DvjymGr1EnmG8JwQkwSWhXbqvr9aG/T56 pYa4uq37D7CPwdMBn/S4kxfmE4lVlgKBrkHFcXyBmMRLMpGFhb3WnVaQ22T2rTvqKcQ5 eR0yDegw5ww7niOPLoWTaXBKBb0mP1MxyZR/YlSe0ru8TCfp11qyBfOqTLgCapLCSKsU 5R3IvYqeGVUbJp6y7NuKUSQQ4CGMlesPwztBxQKaeGorovEjG59T5hDEUm8tkU/Pp7M0 ktRg== X-Gm-Message-State: ALoCoQlE73CPnj9PzXApQBYkgHzj77rEv7wORPP55VnJ+Z9dG/QfQGIRfkXYvS62EUFb3b6nfQZA0AbBPhE3PWfKBt3WMhRFDGL0Q+6CaJ7sB6I2lwUNT30= X-Received: by 10.66.118.204 with SMTP id ko12mr2629822pab.184.1381858359215; Tue, 15 Oct 2013 10:32:39 -0700 (PDT) Received: from bob.qualcomm.com (i-global252.qualcomm.com. [199.106.103.252]) by mx.google.com with ESMTPSA id qn1sm85828747pbc.34.1969.12.31.16.00.00 (version=TLSv1.2 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Oct 2013 10:32:38 -0700 (PDT) From: Michal Kazior To: ath10k@lists.infradead.org Cc: linux-wireless@vger.kernel.org, Michal Kazior Subject: [PATCH 7/7] ath10k: fix FW crashes on heavy TX on 10.1.389 AP FW Date: Tue, 15 Oct 2013 10:29:56 -0700 Message-Id: <1381858196-17000-8-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.4.rc3 In-Reply-To: <1381858196-17000-1-git-send-email-michal.kazior@tieto.com> References: <1381858196-17000-1-git-send-email-michal.kazior@tieto.com> 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=-7.3 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 10.1.389 firmware has some differences in calculation of number of outstanding HTT TX completions. This led to FW crashes of 10.1.389 while main firmware branch was unnaffected. The patch makes sure ath10k doesn't queue up more MSDUs than it should. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/ce.c | 11 +++++++++++ drivers/net/wireless/ath/ath10k/htt_tx.c | 11 ++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/ce.c b/drivers/net/wireless/ath/ath10k/ce.c index e46951b..d243f28 100644 --- a/drivers/net/wireless/ath/ath10k/ce.c +++ b/drivers/net/wireless/ath/ath10k/ce.c @@ -1050,6 +1050,17 @@ struct ath10k_ce_pipe *ath10k_ce_init(struct ath10k *ar, u32 ctrl_addr = ath10k_ce_base_address(ce_id); int ret; + /* + * Make sure there's enough CE ringbuffer entries for HTT TX to avoid + * additional TX locking checks. + * + * For the lack of a better place do the check here. + */ + BUILD_BUG_ON(TARGET_NUM_MSDU_DESC > + (CE_HTT_H2T_MSG_SRC_NENTRIES - 1)); + BUILD_BUG_ON(TARGET_10X_NUM_MSDU_DESC > + (CE_HTT_H2T_MSG_SRC_NENTRIES - 1)); + ret = ath10k_pci_wake(ar); if (ret) return NULL; diff --git a/drivers/net/wireless/ath/ath10k/htt_tx.c b/drivers/net/wireless/ath/ath10k/htt_tx.c index d9335e9..f1d36d2 100644 --- a/drivers/net/wireless/ath/ath10k/htt_tx.c +++ b/drivers/net/wireless/ath/ath10k/htt_tx.c @@ -85,16 +85,13 @@ void ath10k_htt_tx_free_msdu_id(struct ath10k_htt *htt, u16 msdu_id) int ath10k_htt_tx_attach(struct ath10k_htt *htt) { - u8 pipe; - spin_lock_init(&htt->tx_lock); init_waitqueue_head(&htt->empty_tx_wq); - /* At the beginning free queue number should hint us the maximum - * queue length */ - pipe = htt->ar->htc.endpoint[htt->eid].ul_pipe_id; - htt->max_num_pending_tx = ath10k_hif_get_free_queue_number(htt->ar, - pipe); + if (test_bit(ATH10K_FW_FEATURE_WMI_10X, htt->ar->fw_features)) + htt->max_num_pending_tx = TARGET_10X_NUM_MSDU_DESC; + else + htt->max_num_pending_tx = TARGET_NUM_MSDU_DESC; ath10k_dbg(ATH10K_DBG_BOOT, "htt tx max num pending tx %d\n", htt->max_num_pending_tx);