From patchwork Thu Jun 4 00:47:42 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Taehee Yoo X-Patchwork-Id: 6541931 X-Patchwork-Delegate: kvalo@adurom.com 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 1F3D39F1CC for ; Thu, 4 Jun 2015 00:50:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2C667206F7 for ; Thu, 4 Jun 2015 00:50:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0D128206F3 for ; Thu, 4 Jun 2015 00:50:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753136AbbFDAsZ (ORCPT ); Wed, 3 Jun 2015 20:48:25 -0400 Received: from mail-pd0-f177.google.com ([209.85.192.177]:36503 "EHLO mail-pd0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752157AbbFDAsY (ORCPT ); Wed, 3 Jun 2015 20:48:24 -0400 Received: by pdjm12 with SMTP id m12so18510168pdj.3 for ; Wed, 03 Jun 2015 17:48:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=UWWRaKuXMZt3hdqHSrIsAi/omyaUXD+JfTD0Kwydn9k=; b=DTweljP0n6GsbeqYWwFREZx9Ubik+oZF4wA4JWFyk87ekfqEt3YDezd+ozpvyCYSBu rcva44yEeTO7W/hanIXRhawodFxfXfMD+1rIamDSnU1Rq/c/nMw59bJfGftck+3xuanw vyTqMhN/a+qtACfyjzJmaUq4nYALNt3WsXTVPGbGVoxnPIhucbEdpfhNbecPMLNv+JAx emKT94RlVNox0ugFArx1d3ktl11+ySUqk5IQu5dIxA2MumVdT2kuVxzJ633CuSi74Do1 cF/VBv652IlvKbsHay7ZsR7YvyGtHj4bvt1yiVeuuMLMN/5fUv6HD15gkOxFF2DiQz8U bQVg== X-Received: by 10.70.33.102 with SMTP id q6mr62985682pdi.37.1433378903727; Wed, 03 Jun 2015 17:48:23 -0700 (PDT) Received: from localhost.localdomain ([112.153.155.138]) by mx.google.com with ESMTPSA id pj4sm1872505pbb.20.2015.06.03.17.48.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Jun 2015 17:48:22 -0700 (PDT) From: Taehee Yoo To: Larry.Finger@lwfinger.net Cc: ap420073@gmail.com, linux-wireless@vger.kernel.org Subject: [PATCH] rtlwifi: rtl8192cu: Fix performance issue. Date: Thu, 4 Jun 2015 09:47:42 +0900 Message-Id: <1433378862-2064-1-git-send-email-ap420073@gmail.com> X-Mailer: git-send-email 2.1.4 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 After physical reconnect, the rtl8192cu chipset shows low transmission rates.It cause is that variable "iqk_initialized" do not de-initialized. So I add this code. Signed-off-by: Taehee Yoo Acked-by: Larry Finger --- drivers/net/wireless/rtlwifi/rtl8192cu/hw.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c index 1898596..6a4ef05 100644 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/hw.c @@ -987,7 +987,6 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw) struct rtl_phy *rtlphy = &(rtlpriv->phy); struct rtl_ps_ctl *ppsc = rtl_psc(rtl_priv(hw)); int err = 0; - static bool iqk_initialized; unsigned long flags; /* As this function can take a very long time (up to 350 ms) @@ -1038,11 +1037,11 @@ int rtl92cu_hw_init(struct ieee80211_hw *hw) rtlpriv->cfg->ops->set_hw_reg(hw, HW_VAR_ETHER_ADDR, mac->mac_addr); if (ppsc->rfpwr_state == ERFON) { rtl92c_phy_set_rfpath_switch(hw, 1); - if (iqk_initialized) { + if (rtlphy->iqk_initialized) { rtl92c_phy_iq_calibrate(hw, true); } else { rtl92c_phy_iq_calibrate(hw, false); - iqk_initialized = true; + rtlphy->iqk_initialized = true; } rtl92c_dm_check_txpower_tracking(hw); rtl92c_phy_lc_calibrate(hw); @@ -1391,6 +1390,9 @@ void rtl92cu_card_disable(struct ieee80211_hw *hw) _CardDisableHWSM(hw); else _CardDisableWithoutHWSM(hw); + + /* after power off we should do iqk again */ + rtlpriv->phy.iqk_initialized = false; } void rtl92cu_set_check_bssid(struct ieee80211_hw *hw, bool check_bssid)