From patchwork Tue Jul 25 01:13: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: 9860983 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 756A6603F9 for ; Tue, 25 Jul 2017 01:17:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 679C0285D5 for ; Tue, 25 Jul 2017 01:17:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5CA7E285DE; Tue, 25 Jul 2017 01:17:51 +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, 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 F1E77285E8 for ; Tue, 25 Jul 2017 01:17:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757125AbdGYBRq (ORCPT ); Mon, 24 Jul 2017 21:17:46 -0400 Received: from mail-pg0-f48.google.com ([74.125.83.48]:36895 "EHLO mail-pg0-f48.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756607AbdGYBOZ (ORCPT ); Mon, 24 Jul 2017 21:14:25 -0400 Received: by mail-pg0-f48.google.com with SMTP id y129so63969552pgy.4 for ; Mon, 24 Jul 2017 18:14:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YG0NQ3GSfwGWZgc5xMgIxRyF9SmYkhe/zWdb0mZe7rA=; b=Gql8aXivHDOuKpx/FLpbnlGv6adf1o6Rvy5RQs7fz/splx4cC8f2DuXwlT7fkZKIoF B+SWsp3n5VLnyNTgZZTsY2xBynAyOjF8iTYmxsa/BzARdDDdt6da+bhwnpk1R/meY/3a z6i6tBoellww3BSViS4GE6cV6H9MnCidCIzRY= 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:in-reply-to :references; bh=YG0NQ3GSfwGWZgc5xMgIxRyF9SmYkhe/zWdb0mZe7rA=; b=IAflGa2l1zJ0EAVxzjjlY8M4PlpBqUNPjPaqKEccCdZTENTA1eZcR2viv28tW9ZHmy JvxVXTCx1fe7MqDuWDnLw6ToaLaGNCvFkjFjr4/oAuGwBgY4tIO1GBSF2zRl5XGzlaJX HNE9fBr+wCkr2aS5s08zV7hT+DTYvL20ZGsArF22VHoKmY9zpclPn2AI6TJW2Y9M1h9b dJ0b+T9tdPpVbkh+tvPutWeGwYksUEJ/OQqAmr87s2CFpxxCBlGY6cYluI1PhJDEZe4m gUpm4k7ss6dXg0unpI8mChSb1gySwXQDnGEKIpTH0I68GdNBd2Pc8t3KQ0DODY4M0qJ2 CK7Q== X-Gm-Message-State: AIVw113WCR4eFaLLi5G0GbiC+GGBl7Gotzu/3uUw/k3WoKOwwGi7wX9o X25PEdy/buo69E4Q X-Received: by 10.84.167.2 with SMTP id c2mr19305175plb.366.1500945264669; Mon, 24 Jul 2017 18:14:24 -0700 (PDT) Received: from ban.mtv.corp.google.com ([172.22.113.17]) by smtp.gmail.com with ESMTPSA id h123sm21497036pgc.36.2017.07.24.18.14.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 24 Jul 2017 18:14:24 -0700 (PDT) From: Brian Norris To: Ganapathi Bhat , Nishant Sarmukadam Cc: , Dmitry Torokhov , Amitkumar Karwar , Kalle Valo , linux-wireless@vger.kernel.org, Brian Norris Subject: [PATCH v2 15/20] mwifiex: pcie: unify MSI-X / non-MSI-X interrupt process Date: Mon, 24 Jul 2017 18:13:31 -0700 Message-Id: <20170725011336.99993-16-briannorris@chromium.org> X-Mailer: git-send-email 2.14.0.rc0.284.gd933b75aa4-goog In-Reply-To: <20170725011336.99993-1-briannorris@chromium.org> References: <20170725011336.99993-1-briannorris@chromium.org> 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 After removing the interrupt loop in commit 5d5ddb5e0d9b ("mwifiex: pcie: don't loop/retry interrupt status checks"), there is practically zero difference between mwifiex_process_pcie_int() (which handled legacy PCI interrupts and MSI interrupts) and mwifiex_process_msix_int() (which handled MSI-X interrupts). Let's add the one relevant line to mwifiex_process_pcie_int() and kill the copy-and-paste. Signed-off-by: Brian Norris --- new in v2 --- drivers/net/wireless/marvell/mwifiex/pcie.c | 68 ++--------------------------- 1 file changed, 3 insertions(+), 65 deletions(-) diff --git a/drivers/net/wireless/marvell/mwifiex/pcie.c b/drivers/net/wireless/marvell/mwifiex/pcie.c index 2f4da08f127c..c08ebb55a7e8 100644 --- a/drivers/net/wireless/marvell/mwifiex/pcie.c +++ b/drivers/net/wireless/marvell/mwifiex/pcie.c @@ -2417,7 +2417,7 @@ static irqreturn_t mwifiex_pcie_interrupt(int irq, void *context) * In case of Rx packets received, the packets are uploaded from card to * host and processed accordingly. */ -static int mwifiex_process_pcie_int(struct mwifiex_adapter *adapter) +static int mwifiex_process_int_status(struct mwifiex_adapter *adapter) { int ret; u32 pcie_ireg = 0; @@ -2492,75 +2492,13 @@ static int mwifiex_process_pcie_int(struct mwifiex_adapter *adapter) mwifiex_dbg(adapter, INTR, "info: cmd_sent=%d data_sent=%d\n", adapter->cmd_sent, adapter->data_sent); - if (!card->msi_enable && adapter->ps_state != PS_STATE_SLEEP) + if (!card->msi_enable && !card->msix_enable && + adapter->ps_state != PS_STATE_SLEEP) mwifiex_pcie_enable_host_int(adapter); return 0; } -static int mwifiex_process_msix_int(struct mwifiex_adapter *adapter) -{ - int ret; - u32 pcie_ireg; - unsigned long flags; - - spin_lock_irqsave(&adapter->int_lock, flags); - /* Clear out unused interrupts */ - pcie_ireg = adapter->int_status; - adapter->int_status = 0; - spin_unlock_irqrestore(&adapter->int_lock, flags); - - if (pcie_ireg & HOST_INTR_DNLD_DONE) { - mwifiex_dbg(adapter, INTR, - "info: TX DNLD Done\n"); - ret = mwifiex_pcie_send_data_complete(adapter); - if (ret) - return ret; - } - if (pcie_ireg & HOST_INTR_UPLD_RDY) { - mwifiex_dbg(adapter, INTR, - "info: Rx DATA\n"); - ret = mwifiex_pcie_process_recv_data(adapter); - if (ret) - return ret; - } - if (pcie_ireg & HOST_INTR_EVENT_RDY) { - mwifiex_dbg(adapter, INTR, - "info: Rx EVENT\n"); - ret = mwifiex_pcie_process_event_ready(adapter); - if (ret) - return ret; - } - - if (pcie_ireg & HOST_INTR_CMD_DONE) { - if (adapter->cmd_sent) { - mwifiex_dbg(adapter, INTR, - "info: CMD sent Interrupt\n"); - adapter->cmd_sent = false; - } - /* Handle command response */ - ret = mwifiex_pcie_process_cmd_complete(adapter); - if (ret) - return ret; - } - - mwifiex_dbg(adapter, INTR, - "info: cmd_sent=%d data_sent=%d\n", - adapter->cmd_sent, adapter->data_sent); - - return 0; -} - -static int mwifiex_process_int_status(struct mwifiex_adapter *adapter) -{ - struct pcie_service_card *card = adapter->card; - - if (card->msix_enable) - return mwifiex_process_msix_int(adapter); - else - return mwifiex_process_pcie_int(adapter); -} - /* * This function downloads data from driver to card. *