From patchwork Mon Oct 31 08:02:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinming Hu X-Patchwork-Id: 9405117 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 C4E906022E for ; Mon, 31 Oct 2016 08:02:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD1A729217 for ; Mon, 31 Oct 2016 08:02:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E2D12922F; Mon, 31 Oct 2016 08:02:40 +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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM 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 1CD7429217 for ; Mon, 31 Oct 2016 08:02:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761968AbcJaICi (ORCPT ); Mon, 31 Oct 2016 04:02:38 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35775 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761967AbcJaICc (ORCPT ); Mon, 31 Oct 2016 04:02:32 -0400 Received: by mail-pf0-f196.google.com with SMTP id s8so8096810pfj.2 for ; Mon, 31 Oct 2016 01:02:32 -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=Ye7bdvZoKZaguETthc6teg9BPmPXk6FgajxwMVyUpZY=; b=Zzy04R22U0lbs1hqR0E5OFS0YS54V3gfV9f7ZUGjS/Yu0LFQpuWdduf0hfZ0Ny+zTu lqqgdRqzSS+EIZ6vfjgR+/1gR+ZD3j4mTdF4y4JqAdkg449NhBniuwNJDF725Pl/519L eSiZQZkaZjrEReQXVRD3+lHvV6eQnef5NHLEboWiTIhDxR+dpSib+Id2/TUpNGJBW25z d3XtJSHIJqVgq6HFb1cOC2qUewDhjIxoAENKYOLJtKvDkRi5y3gC9LqdPyMnR+M3cqtn 2Kt3kLGrIqq3rx3sAK8tTDv/ZtJ/Fb5lJ/PqjYI3fJMew2fW84n5C3vIkgiROALqzF2G QtBg== 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; bh=Ye7bdvZoKZaguETthc6teg9BPmPXk6FgajxwMVyUpZY=; b=Tj+Pxu/yyHLZEtoa0+LCeN35c7Vspwg6ARLcOETpblUxj4++8rB4bJAysRsxvOgXQ0 ywrC0QM4nQdRHkvZH60M6Rkmwfa9lBgU9XV6lChMeJ6ywAcuSFcoukJjy2ivyVGdaenY LnAJUI4YkvHUAl6s/+JdVIEc04ysXUH6vp/nU5+kM0O8UQZVnPaM/a9qWkvl+J3fvwFM q7mUPgIL73uMg94twySdUmSLDiVUOg5Dwuvih/RCaILNThRzQbAnaEVT98CRbL/FRt7C 7w6/Z8nfJoHCRiPIlEBeyMEJfTPOF9Taq9OZKz6SZLhYWo9XOfqYYGoGUah8kiMecNt0 drpw== X-Gm-Message-State: ABUngvdZ25gYRV5+UWxzKjKyu0un4hnKohPVbpsKtMSjThn8JWg1VayNXjktwbpqJkMi/A== X-Received: by 10.99.171.3 with SMTP id p3mr39119507pgf.119.1477900951393; Mon, 31 Oct 2016 01:02:31 -0700 (PDT) Received: from localhost.localdomain ([216.207.47.6]) by smtp.gmail.com with ESMTPSA id k7sm34121196pan.8.2016.10.31.01.02.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 31 Oct 2016 01:02:30 -0700 (PDT) From: Xinming Hu X-Google-Original-From: Xinming Hu To: Linux Wireless Cc: Kalle Valo , Brian Norris , Dmitry Torokhov , Amitkumar Karwar , Cathy Luo , Shengzhen Li Subject: [PATCH 01/12] mwifiex: fix power save issue when suspend Date: Mon, 31 Oct 2016 16:02:09 +0800 Message-Id: <1477900940-10549-1-git-send-email-huxinming820@marvell.com> X-Mailer: git-send-email 1.9.1 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: Shengzhen Li This patch fixes a corner case for "FROMLIST: mwifiex: fix corner case power save issue", main process will check the power save condition in PS_PRE_SLEEP status so the sleep handshake could continue. Signed-off-by: Cathy Luo Signed-off-by: Shengzhen Li Signed-off-by: Amitkumar Karwar BUG=chrome-os-partner:58164 TEST=stress Wifi w/ power_save enabled Change-Id: I5a36d9eaeb7fe5faaccc533e0d1ba1f3253666dc --- drivers/net/wireless/marvell/mwifiex/cmdevt.c | 3 ++- drivers/net/wireless/marvell/mwifiex/main.c | 5 +++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c index 5347728..9075be5 100644 --- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c +++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c @@ -1123,8 +1123,9 @@ mwifiex_check_ps_cond(struct mwifiex_adapter *adapter) mwifiex_dnld_sleep_confirm_cmd(adapter); else mwifiex_dbg(adapter, CMD, - "cmd: Delay Sleep Confirm (%s%s%s)\n", + "cmd: Delay Sleep Confirm (%s%s%s%s)\n", (adapter->cmd_sent) ? "D" : "", + (adapter->data_sent) ? "T" : "", (adapter->curr_cmd) ? "C" : "", (IS_CARD_RX_RCVD(adapter)) ? "R" : ""); } diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index 2478ccd..f559ead 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -308,6 +308,11 @@ process_start: /* We have tried to wakeup the card already */ if (adapter->pm_wakeup_fw_try) break; + if (adapter->ps_state == PS_STATE_PRE_SLEEP) { + if (!adapter->cmd_sent && !adapter->curr_cmd) + mwifiex_check_ps_cond(adapter); + } + if (adapter->ps_state != PS_STATE_AWAKE) break; if (adapter->tx_lock_flag) {