From patchwork Wed Dec 10 12:31:52 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Kazior X-Patchwork-Id: 5468801 Return-Path: X-Original-To: patchwork-ath10k@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 83D16BEEA8 for ; Wed, 10 Dec 2014 12:45:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7E85B20173 for ; Wed, 10 Dec 2014 12:45:23 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E79E32015A for ; Wed, 10 Dec 2014 12:45:21 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XygdN-000823-1Z; Wed, 10 Dec 2014 12:44:49 +0000 Received: from mail-wi0-x233.google.com ([2a00:1450:400c:c05::233]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XygdH-0007wK-U4 for ath10k@lists.infradead.org; Wed, 10 Dec 2014 12:44:45 +0000 Received: by mail-wi0-f179.google.com with SMTP id ex7so5019621wid.6 for ; Wed, 10 Dec 2014 04:44:22 -0800 (PST) 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=R/uWscAXX9eFMfjJKX+vCdySJqz853oIXZSPoXN1I1s=; b=DB1L5mYhJzvyGCbbTmEcESW6maVxsEJDH6ytDuVHBHo8WIKcA55dM1sH4/Hnc1czDx i31T3NjYizcR3SYljMaFI7/PsaEqJWpEd9HnToc9Wurjs6i2Ec4GomoSll6vPZAOfYK3 cc31KBLiBCpqC8UOWNataBR9XeLDxZlGnbUHM= 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=R/uWscAXX9eFMfjJKX+vCdySJqz853oIXZSPoXN1I1s=; b=M8L2C9FxUqHk2y8vUsJU00ddXZtWLgHJAVViJXm/sFL1WWolt9HpxbOmTVgDVlNK3E +l/fQTKEe/UwydijzzRQr4tC/4grzOkfvFoQsdR8lQVO2D3fXT8ABKrKKXKA0lx02HIZ RwEaKf9/GaMfAxZI1xpvOCkpkp/O+OST22ayRvnqyNAcs+1zYf0Tgc337adUasfNxnmw ECisWE8QdCdCvcGeEnPISdjdLsKcvzl+6949cpyUz3ZOOxEdWHhXt4F1/2ZPU9+AWkJa Mn0EHj28qRYHLvzAGO3Mom1FxzwU5EnxB3Zd0qwek4gzHd7QnJn1A/kYX75MQA90puIw 5olQ== X-Gm-Message-State: ALoCoQn0/VN4jHaL+IDPGu6iXY/Kbbx57PtSYWf07ht778cOrtDl3ZWb41R9HVgGWO5f7cNc/67Pa3RwBRO9xe13dHhV2sqwD9lrGKGXW/UEUlZ4KSQXWOt9NSzQvcyUcKGBA9GxopmnlFHFMb6Okm5trXtJp4fKUiwvyyDLYuZ3Ym7+WDsUQjk= X-Received: by 10.180.23.98 with SMTP id l2mr12890259wif.51.1418215461902; Wed, 10 Dec 2014 04:44:21 -0800 (PST) Received: from localhost.localdomain ([91.198.246.8]) by mx.google.com with ESMTPSA id b10sm6203642wiw.9.2014.12.10.04.44.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Dec 2014 04:44:21 -0800 (PST) From: Michal Kazior To: ath10k@lists.infradead.org Subject: [PATCH 3/5] ath10k: prevent invalid ps timeout config Date: Wed, 10 Dec 2014 13:31:52 +0100 Message-Id: <1418214714-29689-4-git-send-email-michal.kazior@tieto.com> X-Mailer: git-send-email 1.8.5.3 In-Reply-To: <1418214714-29689-1-git-send-email-michal.kazior@tieto.com> References: <1418214714-29689-1-git-send-email-michal.kazior@tieto.com> X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20141210_044444_137694_7D3F2AA6 X-CRM114-Status: GOOD ( 10.31 ) X-Spam-Score: -0.8 (/) Cc: linux-wireless@vger.kernel.org, Michal Kazior X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_LOW, 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 Setting 0 ps timeout to firmware yields very poor latency and traffic issues. This is the case when multi-vif is active. Signed-off-by: Michal Kazior --- drivers/net/wireless/ath/ath10k/mac.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/mac.c b/drivers/net/wireless/ath/ath10k/mac.c index 969d187..d41e3d5 100644 --- a/drivers/net/wireless/ath/ath10k/mac.c +++ b/drivers/net/wireless/ath/ath10k/mac.c @@ -1079,10 +1079,12 @@ static int ath10k_mac_vif_recalc_ps_wake_threshold(struct ath10k_vif *arvif) static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif) { struct ath10k *ar = arvif->ar; + struct ieee80211_vif *vif = arvif->vif; struct ieee80211_conf *conf = &ar->hw->conf; enum wmi_sta_powersave_param param; enum wmi_sta_ps_mode psmode; int ret; + int ps_timeout; lockdep_assert_held(&arvif->ar->conf_mutex); @@ -1093,8 +1095,15 @@ static int ath10k_mac_vif_setup_ps(struct ath10k_vif *arvif) psmode = WMI_STA_PS_MODE_ENABLED; param = WMI_STA_PS_PARAM_INACTIVITY_TIME; + ps_timeout = conf->dynamic_ps_timeout; + if (ps_timeout == 0) { + /* Firmware doesn't like 0 */ + ps_timeout = ieee80211_tu_to_usec( + vif->bss_conf.beacon_int) / 1000; + } + ret = ath10k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param, - conf->dynamic_ps_timeout); + ps_timeout); if (ret) { ath10k_warn(ar, "failed to set inactivity time for vdev %d: %i\n", arvif->vdev_id, ret);