From patchwork Mon Oct 31 07:42:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinming Hu X-Patchwork-Id: 9405111 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 7C17560234 for ; Mon, 31 Oct 2016 07:43:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BEC0291FE for ; Mon, 31 Oct 2016 07:43:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5F35229205; Mon, 31 Oct 2016 07:43:01 +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 DCD02291FE for ; Mon, 31 Oct 2016 07:43:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1761674AbcJaHm5 (ORCPT ); Mon, 31 Oct 2016 03:42:57 -0400 Received: from mail-pf0-f196.google.com ([209.85.192.196]:35825 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761666AbcJaHmz (ORCPT ); Mon, 31 Oct 2016 03:42:55 -0400 Received: by mail-pf0-f196.google.com with SMTP id s8so8054274pfj.2 for ; Mon, 31 Oct 2016 00:42:55 -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=8s29g6VGbHMHMCHSdxMhMnYbfQX/YguSyScER5ia4vg=; b=CfghsdOlDJEjsxcwtj1ct7cqRh5xQzKP0RKnw4Pc4r+ZT/acN3QwKoLFhuDCZf+Z4X hClbUIBtOk2KyT04336JoPuZV4GR5tcVyreM2wo0A6G3/WhwiAMNLnySskpFgy/O3v3v D6NjfVcVD/nsQaT9S+EYckZrttQuc+/5wj2dcU2y0vNkyA4cOSzOZFYZIAFgXfAxZkcI 0g4+71RLuPkElaoPzMxcBFTmYnFednwNoO7wys9pGm7dTOMEfNl/4Uh8YDyByvDNIuN4 tan5kfA3aRgpierxIY/8gbOSGoSyz2YLZYCiq71Bi7IL928JpKZ+Txhx2Hdnj5xgCKQk 3zyA== 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=8s29g6VGbHMHMCHSdxMhMnYbfQX/YguSyScER5ia4vg=; b=KvC/UIOdfYta0/0e4JVO1bz/b57OpjidSqIs1+ZpNtY+n8xAZ2rTpjBcX9vDnEhcPc R+xLYq0OhvQN9+RAcqfUZxwWGh925FA84EhF0iq5PYKZ1TqhHfVmjnpxi75+9f+GiovK 3Oqryx/vUDGd5tot6kePuzYpHV2z1ZRuj+tBVu+0xtznTqG3HxahRWJFW9OdlIO3qRvz vmF+p62yJGFCKMgzlyaFCB6eIDw4DNjDsH61MKIAtyZX+VsNfrHz5AK8Y/EO3HS/Mode f3YK9RoZeBk3rNKvot+jLcMMz3jBf0AeH+v4qC0Ytf7saNtXmLhQ1efX5nKj/o/1L1nU glxQ== X-Gm-Message-State: ABUngvf+c3yqPKGmayTo05pzWS3rkIQcEIDdWsh+RQLXq1Hdqno089dR2IIre9DijqtCWA== X-Received: by 10.98.11.71 with SMTP id t68mr6472705pfi.136.1477899774820; Mon, 31 Oct 2016 00:42:54 -0700 (PDT) Received: from localhost.localdomain ([216.207.47.6]) by smtp.gmail.com with ESMTPSA id k7sm33995618pan.8.2016.10.31.00.42.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 31 Oct 2016 00:42:54 -0700 (PDT) From: Xinming Hu To: linux-wireless@vger.kernel.org Cc: Shengzhen Li Subject: [TEST V2 GIT-SEND-EMAIL, PATCH 01/11] mwifiex: fix power save issue when suspend Date: Mon, 31 Oct 2016 15:42:43 +0800 Message-Id: <1477899763-10273-1-git-send-email-huxinming820@gmail.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: Shengzhen Li --- 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) {