From patchwork Tue Nov 1 12:08:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinming Hu X-Patchwork-Id: 9407283 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 CCC4C60722 for ; Tue, 1 Nov 2016 12:09:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C15832984F for ; Tue, 1 Nov 2016 12:09:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B5EF829856; Tue, 1 Nov 2016 12:09:24 +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 8C5CB29850 for ; Tue, 1 Nov 2016 12:09:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1163035AbcKAMIl (ORCPT ); Tue, 1 Nov 2016 08:08:41 -0400 Received: from mail-pf0-f194.google.com ([209.85.192.194]:32901 "EHLO mail-pf0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965912AbcKAMIj (ORCPT ); Tue, 1 Nov 2016 08:08:39 -0400 Received: by mail-pf0-f194.google.com with SMTP id a136so8165546pfa.0 for ; Tue, 01 Nov 2016 05:08:39 -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:in-reply-to:references; bh=ScAm5vHzXUUhRXvxKRLDAqmHiAKGE06qzNJGamBJW4E=; b=K9W5HjsGrkK/wdjMn3AAOQ3ZPJb8c8Xkx8p17tnfZZciyuAXdgNlD5P5IxjDMrlJju UQm247IBeqeC2Th2W5oPcy7WdBYitUW1IqGwchGdx7DyIJssc8mCyLpvGTsPSNDGNMFW qnaTEEGjuCxf4A4QrRYAeV3iIngIX1htfgyUoFDCyimJUWtvRt904w6c5+4l8p1QZitB MWxwvcEhIN0YxcPKAPfnDOIyPiTq57AS5QxQPQtgGALWKwONnXTgIikl3gL/L1pLglaH iHGHsDh2I/aXBMSzPgQuJrh2187p6tAhhZYWceFyAtFKZoMFdzc0H9Dtc5U+rBFQNxsw q1fg== 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=ScAm5vHzXUUhRXvxKRLDAqmHiAKGE06qzNJGamBJW4E=; b=Aq7LGqbjy+2eNuOQY53ZXTVBIbt1N28lbXhroO7BDuzAdswy4FpLdIwy5mn0hRQnbq wfTi2KmFX5D4wYRbbclHJ3qTB98TohSm6ZkL077WXhmS/7av9ipDMRqYS56AS1znKbfl HduEmikko1Rk1WLAmc9VrRO8N8KMKJXUsc6o8KWQOxM4yMmQpC1xSUWcn34V3lSFGHQB vgfCdutAJAPAoRT0g6OFUImSu4BSs5jEp2tAyn/MnN8aD5AWdCwIskRtgKz1IgtivYHF jaTTvKx7LjxyUkiYgoJocL1edVOIBiE941S/7EakHVK9OxuAg1jKGQGxX4GSxTyoryEp 9EjA== X-Gm-Message-State: ABUngvfZywxYmvERZK/l5vCDdE8EVoUQEJrb4NDX04JjTY0XliR52F0F0bvwuk8ZHtgd3A== X-Received: by 10.98.194.68 with SMTP id l65mr59815536pfg.159.1478002119097; Tue, 01 Nov 2016 05:08:39 -0700 (PDT) Received: from localhost.localdomain ([216.207.47.6]) by smtp.gmail.com with ESMTPSA id e7sm41905019pfa.65.2016.11.01.05.08.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Nov 2016 05:08:38 -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 , Xinming Hu Subject: [PATCH v2 02/12] mwifiex: complete blocked power save handshake in main process Date: Tue, 1 Nov 2016 20:08:18 +0800 Message-Id: <1478002098-14189-2-git-send-email-huxinming820@marvell.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1478002098-14189-1-git-send-email-huxinming820@marvell.com> References: <1478002098-14189-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. --- v2: 1. remove redudant check(Brain) 3. reorgnized to follow tx_hw_pending patch --- Signed-off-by: Cathy Luo Signed-off-by: Shengzhen Li Signed-off-by: Xinming Hu Signed-off-by: Amitkumar Karwar --- 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 2478ccd..d700c44 100644 --- a/drivers/net/wireless/marvell/mwifiex/main.c +++ b/drivers/net/wireless/marvell/mwifiex/main.c @@ -308,6 +308,9 @@ 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) + mwifiex_check_ps_cond(adapter); + if (adapter->ps_state != PS_STATE_AWAKE) break; if (adapter->tx_lock_flag) { @@ -355,10 +358,8 @@ process_start: /* 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.