From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750888AbdALVCp (ORCPT ); Thu, 12 Jan 2017 16:02:45 -0500 Received: from mail-pf0-f176.google.com ([209.85.192.176]:33367 "EHLO mail-pf0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750832AbdALVCn (ORCPT ); Thu, 12 Jan 2017 16:02:43 -0500 From: Brian Norris To: Amitkumar Karwar , Nishant Sarmukadam Cc: , Kalle Valo , linux-wireless@vger.kernel.org, Cathy Luo , Brian Norris Subject: [PATCH 1/2] mwifiex: pcie: use posted write to wake up firmware Date: Thu, 12 Jan 2017 13:02:31 -0800 Message-Id: <20170112210232.18554-1-briannorris@chromium.org> X-Mailer: git-send-email 2.11.0.390.gc69c2f50cf-goog Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Depending on system factors (e.g., the PCIe link PM state), the first read to wake up the Wifi firmware can take a long time. There is no reason to use a (blocking, non-posted) read at this point, so let's just use a write instead. Write vs. read doesn't matter functionality-wise -- it's just a dummy operation. This has been shown to decrease the time spent blocking in this function on a Rockchip RK3399 SoC. Signed-off-by: Brian Norris --- drivers/net/wireless/marvell/mwifiex/pcie.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c index 66226c615be0..435ba879ef29 100644 --- a/drivers/net/wireless/marvell/mwifiex/pcie.c +++ b/drivers/net/wireless/marvell/mwifiex/pcie.c @@ -458,7 +458,6 @@ static void mwifiex_delay_for_sleep_cookie(struct mwifiex_adapter *adapter, /* This function wakes up the card by reading fw_status register. */ static int mwifiex_pm_wakeup_card(struct mwifiex_adapter *adapter) { - u32 fw_status; struct pcie_service_card *card = adapter->card; const struct mwifiex_pcie_card_reg *reg = card->pcie.reg; @@ -468,10 +467,10 @@ static int mwifiex_pm_wakeup_card(struct mwifiex_adapter *adapter) if (reg->sleep_cookie) mwifiex_pcie_dev_wakeup_delay(adapter); - /* Reading fw_status register will wakeup device */ - if (mwifiex_read_reg(adapter, reg->fw_status, &fw_status)) { + /* Accessing fw_status register will wakeup device */ + if (mwifiex_write_reg(adapter, reg->fw_status, 0)) { mwifiex_dbg(adapter, ERROR, - "Reading fw_status register failed\n"); + "Writing fw_status register failed\n"); return -1; } -- 2.11.0.390.gc69c2f50cf-goog