From patchwork Thu Nov 10 11:57:03 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinming Hu X-Patchwork-Id: 9420959 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 7FF7B601C0 for ; Thu, 10 Nov 2016 11:57:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BE3D2954D for ; Thu, 10 Nov 2016 11:57:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 605F32956E; Thu, 10 Nov 2016 11:57:46 +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=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI 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 02A8E2954D for ; Thu, 10 Nov 2016 11:57:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755633AbcKJL5n (ORCPT ); Thu, 10 Nov 2016 06:57:43 -0500 Received: from mail-pf0-f195.google.com ([209.85.192.195]:32814 "EHLO mail-pf0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755627AbcKJL5m (ORCPT ); Thu, 10 Nov 2016 06:57:42 -0500 Received: by mail-pf0-f195.google.com with SMTP id 144so3985573pfv.0 for ; Thu, 10 Nov 2016 03:57:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=2d+Bbdje8/WGlF96JXhQwXLCll04D0JckfaggAduOPc=; b=A/rLmUIZzbdKNdIhMRKiikx5mvryeGxigVXTI4qAhutDJYDRHqBGYrRBK+s+CjKSYH 2sI1rm2p+Sb+81LlYR6dVK3NTgYM4kS6+RlwjSJ6OSxxyq9bmt5Qa8TN19fCHrb49BBM IDYs96PloPd+K3xygfR9/L9jb+1dDC5kgRFSfvcItzmCvMHX2zxTHbgm/c6yLeMG6oE4 hnaDLYoLXdUp7mNJWiM5lPLkEvIve4grG/jKAX+YKZILXRH7WUZBKAMiZL+Kh778ifBn CLK5VHTX6vKz/a2s8L0atRWIguqQqTMWt32bRcT3dnNws6EyYvKFoZiWkeU1v2FHgYci 1Nzg== 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=2d+Bbdje8/WGlF96JXhQwXLCll04D0JckfaggAduOPc=; b=GHaGHg3sC/s7QWIRaFcfcdleFZxd4Jta6EW7aajAfug3rxbfcEVQ2u+YQhaXjXC7df WA7ZO5FJtuanNnQ+9LX+VHTkh55RSD8EVXpgzJDEMzivgiUDE34r0XyzJmHnaviFv4KC wk8DMvxAYBjStvW351LM8lscZOZWOYAtqTQv4aNtUyoCFhk07U5l9cLtkxkHklPdghH/ L+eZqvIsKsZKwJQfH9kuixAaeXfuXIiI4pUYBRuixDPy2Ey4VMFLj2SfJKOBN6Pqy9Ib y2oIQY53rgl6OxQlX5UBRGSNiSzD2joDPEg6eaggo9+vggCi1Vp/CWVu1szTvIzXFgpk dZrQ== X-Gm-Message-State: ABUngvcWfSBEtnOKzB8gb9gFIvmzxEgBvNJpAUASB+BDoKOmeIKWIjh4u4VNSZbLBZ7K+A== X-Received: by 10.98.34.68 with SMTP id i65mr9359546pfi.135.1478779062103; Thu, 10 Nov 2016 03:57:42 -0800 (PST) Received: from localhost.localdomain ([216.207.47.6]) by smtp.gmail.com with ESMTPSA id v10sm6740890pag.44.2016.11.10.03.57.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 10 Nov 2016 03:57:41 -0800 (PST) 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 , Xinming Hu Subject: [PATCH RESEND v2 02/11] mwifiex: complete blocked power save handshake in main process Date: Thu, 10 Nov 2016 19:57:03 +0800 Message-Id: <1478779032-5165-2-git-send-email-huxinming820@marvell.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1478779032-5165-1-git-send-email-huxinming820@marvell.com> References: <1478779032-5165-1-git-send-email-huxinming820@marvell.com> 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 Power save handshake with firmware might be blocked by on-going data transfer. this patch check the PS status in main process and complete previous blocked PS handshake. this patch also remove redudant check before call mwifiex_check_ps_cond fuction. Signed-off-by: Cathy Luo Signed-off-by: Shengzhen Li Signed-off-by: Xinming Hu Signed-off-by: Amitkumar Karwar --- v2: 1. remove redudant check(Brain) 2. reorgnized to follow tx_hw_pending patch --- drivers/net/wireless/marvell/mwifiex/main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/main.c b/drivers/net/wireless/marvell/mwifiex/main.c index 20c9b77..c710d5e 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -308,6 +308,9 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter) /* We have tried to wakeup the card already */ if (adapter->pm_wakeup_fw_try) break; + if (adapter->ps_state == PS_STATE_PRE_SLEEP) + mwifiex_check_ps_cond(adapter); + if (adapter->ps_state != PS_STATE_AWAKE) break; if (adapter->tx_lock_flag) { @@ -355,10 +358,8 @@ int mwifiex_main_process(struct mwifiex_adapter *adapter) /* Check if we need to confirm Sleep Request received previously */ - 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_PRE_SLEEP) + mwifiex_check_ps_cond(adapter); /* * The ps_state may have been changed during processing of * Sleep Request event.