From patchwork Thu Jan 12 21:02:31 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 9514189 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 200E560476 for ; Thu, 12 Jan 2017 21:03:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 128E328658 for ; Thu, 12 Jan 2017 21:03:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0701A286FF; Thu, 12 Jan 2017 21:03:12 +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, RCVD_IN_DNSWL_HI autolearn=unavailable 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 9584928658 for ; Thu, 12 Jan 2017 21:03:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750862AbdALVCo (ORCPT ); Thu, 12 Jan 2017 16:02:44 -0500 Received: from mail-pf0-f172.google.com ([209.85.192.172]:35991 "EHLO mail-pf0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750761AbdALVCn (ORCPT ); Thu, 12 Jan 2017 16:02:43 -0500 Received: by mail-pf0-f172.google.com with SMTP id 189so18655229pfu.3 for ; Thu, 12 Jan 2017 13:02:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id; bh=XI0HzaRMXBI39rk/9heHAfzrPwriF6LVclAoKIw/1gg=; b=FIZZIFEWCKmNujLS8G1UOGgRt1+/9vQwTr8gqZbDrWMRTuRXNl1jjU5yBD+OrUwj8D +viojwGtrwSlICT+raHXLu/MuvEY+aAToFiahWWn9VaXhU/7qq9izM1y4y8Rl+GnYmmD L8jFDkhgmhdOZP2CBZH/4n6l6QeLgX3JY0BzI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XI0HzaRMXBI39rk/9heHAfzrPwriF6LVclAoKIw/1gg=; b=HwARlkepd/J1BPIy9ZGNnnyDu7gSsxYYRwHfLu0ND7IRCMlSoJPAm1Mnf62mbGGCSn kmPF39O3mb9isdAH3Y3aGUS8k4lH685z4LH9tkYvcyJGjJX34atTO4HffYMhDEgQ4Tpw vPZOit3lRjcpq3dJtZd8UuZt79W2SXIODZFnj440QpwNRygr3kuTmMFi8DQBIi6u/B2O 2nl0Hc6zH7Ebese2Jp5MimjaFVwEHNgxQqaC0ARwZ3JQ79lG+a5HZMyVKhNfvLpxu9df rvpoL8Q4Lo88i+FApUbxOgrs4Kmh02CT0rwBR89vymCrTuGEpWpEoO++BaDIVk2Pvc3S Thow== X-Gm-Message-State: AIkVDXJqFw7SsDWWLLDTbGv5FPwgpMN94SeJuQ1uG4WyBaY+IlEJdSUfGO/rq2/BMvr7Eaqt X-Received: by 10.98.6.131 with SMTP id 125mr18734863pfg.95.1484254962759; Thu, 12 Jan 2017 13:02:42 -0800 (PST) Received: from ban.mtv.corp.google.com ([172.22.64.120]) by smtp.gmail.com with ESMTPSA id p13sm23863380pgf.47.2017.01.12.13.02.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 12 Jan 2017 13:02:42 -0800 (PST) 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-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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; }