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: 5468721 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 01CB6BEEA8 for ; Wed, 10 Dec 2014 12:44:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E57082010C for ; Wed, 10 Dec 2014 12:44:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1196B2010B for ; Wed, 10 Dec 2014 12:44:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755152AbaLJMoY (ORCPT ); Wed, 10 Dec 2014 07:44:24 -0500 Received: from mail-wg0-f41.google.com ([74.125.82.41]:49295 "EHLO mail-wg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754961AbaLJMoX (ORCPT ); Wed, 10 Dec 2014 07:44:23 -0500 Received: by mail-wg0-f41.google.com with SMTP id y19so3490311wgg.14 for ; Wed, 10 Dec 2014 04:44:21 -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=X23l9eWQqCNQl/xRyujpzKdZig1WizkuWo5mDZZbYsdHohpba21YNuNdJwbYSEqE+W otcmS+kYRgKm1J4AVCh/KsbGsOl06dvSeG227g/pzKeEdav2hTKDJFlNvTS1qRxMll+z FmcpMS1I1R+eKlOG21a2DVT7iblbCoU9GvuqK+yFzTfMx6lEdnsrf7DLSgcx0nBSEXo0 cYpqAEDoPHDaMBcpr8w/ffy01Wjf3PyaiLbDQBOrMyUqKaPc8flMPO8tFbeGVzKj4TCs 6ghnk6pLNi3o09br8TltWVaSGJ8fYHT37RJ8m41xfWqQtfhOv28Q4Z1dVL4yuAR7J9Gw 8zfg== X-Gm-Message-State: ALoCoQl59qISONFbAKoiMP+vfZg3Jr/IlMQVl23OSmkCrWMnKcgt2WOH1FuF+w9n+FQi1D1H8n0HS+goLGk+6WeZs2PvUDOuGyM71d1/KITXGkqWLLVxWuscyA+sMqauWMI2KY5cinDk 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 Cc: linux-wireless@vger.kernel.org, Michal Kazior 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 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,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);