From patchwork Wed Nov 1 15:29:26 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Larry Finger X-Patchwork-Id: 10036505 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 17F93604D7 for ; Wed, 1 Nov 2017 15:29:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0C86E201BC for ; Wed, 1 Nov 2017 15:29:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 01710286AA; Wed, 1 Nov 2017 15:29:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.6 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID, URIBL_BLACK autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A751328628 for ; Wed, 1 Nov 2017 15:29:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754732AbdKAP3p (ORCPT ); Wed, 1 Nov 2017 11:29:45 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:43907 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752194AbdKAP3n (ORCPT ); Wed, 1 Nov 2017 11:29:43 -0400 Received: by mail-oi0-f67.google.com with SMTP id c77so5044308oig.0 for ; Wed, 01 Nov 2017 08:29:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=Oiv+9UT3vVhD4CQxCiHUjfikdlejLDYO25PI/77UeMo=; b=t3slpTQnFB1fzFXjunQWQf1dKP9Sg3HOF4zMIZbbD1q79KhE9p+WgVHzswEYqImYth eDgqED05uyKndA24UaIzyezNqAWDykc1l6MmilCONX1GypEG51QCqgRFhV0zvgMpSx4Z utRFHGuMLNmQrzZLG/zv7GGowIPdHdXeIJC8aM4tZPmGmuceWWmEORUtF10oRZu6VpMM yGm2iWXeGXHAuDAcacbw5B27GMNEjHWfYFU3WamLrfHwC4vQ5vLG55JjrlnuDuLt8Xtq pgRBcYTgLC4QtN0tAebsFTlcUmyXfbfkZI0z40JuxGqJittlCmnd3UB5qBdzWYrULgm/ uwuA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=Oiv+9UT3vVhD4CQxCiHUjfikdlejLDYO25PI/77UeMo=; b=k3hwqH/mwbsj64q+EHuBvtjaUQpC2YvEuGoEkN/79VEa4dP4W6cxURPKnEYlTbDPxh JxgeqSiKFHysOtXardHT0SZy/CzpGPECJUVIBt3GrkO9yYMV8itkcC9IzLr907LFg6X6 2OHoqGwNhiTDETbM9kr6KZrUGBLvRh7zCWNle0FEfDeBnLZqhQLCZdu1PJTCEtw+FLSn RVCBn6rtDZcNVhqBseXSo085xPVZYIN1nUpovG3/Fc5CopwNIiCx9kC5LV3utO9VyiMf icWNVEoxHmGOoMWDpQXPuR/0EnaHM2uftoGu89mhtjwQgd580lRbk3ZPbGFO15i7yyDU yKDg== X-Gm-Message-State: AMCzsaXMzMAaZQlh4BuPM6eoNrv4y+9Ghbwx8C2Kj0t0Tg+M8gVOOaYL RLyLlFmqMpBEPkznITu8QlM= X-Google-Smtp-Source: ABhQp+RiQHXN+kuIHc/0DdfORfsYnh7T/QYDbL1/kv/bpQvpFrQ+N6cEGwI9EdegN2UcTFAUMQxmzQ== X-Received: by 10.202.221.8 with SMTP id u8mr126673oig.121.1509550182935; Wed, 01 Nov 2017 08:29:42 -0700 (PDT) Received: from Larrylap.localdomain (cpe-24-31-251-255.kc.res.rr.com. [24.31.251.255]) by smtp.gmail.com with ESMTPSA id v21sm338515ote.49.2017.11.01.08.29.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 01 Nov 2017 08:29:42 -0700 (PDT) From: Larry Finger To: kvalo@codeaurora.org Cc: linux-wireless@vger.kernel.org, Tsang-Shian Lin , Ping-Ke Shih , Larry Finger , Yan-Hsuan Chuang , Birming Chiu , Shaofu , Steven Ting Subject: [PATCH 11/11] rtlwifi: rtl_pci: Fix the bug when inactiveps is enabled. Date: Wed, 1 Nov 2017 10:29:26 -0500 Message-Id: <20171101152926.24971-12-Larry.Finger@lwfinger.net> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20171101152926.24971-1-Larry.Finger@lwfinger.net> References: <20171101152926.24971-1-Larry.Finger@lwfinger.net> Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Tsang-Shian Lin Reset the driver current tx read/write index to zero when inactiveps nic off to sync with HW state. Wrong driver tx read/write index will cause Tx fail. Signed-off-by: Tsang-Shian Lin Signed-off-by: Ping-Ke Shih Signed-off-by: Larry Finger Cc: Yan-Hsuan Chuang Cc: Birming Chiu Cc: Shaofu Cc: Steven Ting --- drivers/net/wireless/realtek/rtlwifi/pci.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/wireless/realtek/rtlwifi/pci.c b/drivers/net/wireless/realtek/rtlwifi/pci.c index 01c93721eca9..3aa0266a3e04 100644 --- a/drivers/net/wireless/realtek/rtlwifi/pci.c +++ b/drivers/net/wireless/realtek/rtlwifi/pci.c @@ -1558,7 +1558,14 @@ int rtl_pci_reset_trx_ring(struct ieee80211_hw *hw) dev_kfree_skb_irq(skb); ring->idx = (ring->idx + 1) % ring->entries; } + + if (rtlpriv->use_new_trx_flow) { + rtlpci->tx_ring[i].cur_tx_rp = 0; + rtlpci->tx_ring[i].cur_tx_wp = 0; + } + ring->idx = 0; + ring->entries = rtlpci->txringcount[i]; } } spin_unlock_irqrestore(&rtlpriv->locks.irq_th_lock, flags);