From patchwork Thu Sep 17 06:17:33 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janusz.Dziedzic@tieto.com X-Patchwork-Id: 7202571 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D98379F32B for ; Thu, 17 Sep 2015 06:18:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE845208C5 for ; Thu, 17 Sep 2015 06:18:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1B889207F5 for ; Thu, 17 Sep 2015 06:18:31 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZcSWV-0002D5-V6; Thu, 17 Sep 2015 06:18:23 +0000 Received: from mail-lb0-x22a.google.com ([2a00:1450:4010:c04::22a]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZcSWT-00027g-8b for ath10k@lists.infradead.org; Thu, 17 Sep 2015 06:18:22 +0000 Received: by lbcao8 with SMTP id ao8so3919797lbc.3 for ; Wed, 16 Sep 2015 23:17:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=tieto.com; s=google; h=from:to:cc:subject:date:message-id; bh=t7ZeigiIOTuiNdOiTV9BljxEaI8RNrOxudQpUPPDEUw=; b=xNTEmIf/mHkVSB51zQGWwANMxRdNYWQ2cEddp8UcZfuIsCZt0uF7yHCcfxgnsZa92Y cJrJpIk+gru+00bwF+aHAqelndlnKFUEISDzlhUaSBWaKe4m0CvMos3sZajMlzu2RqhD rOksccDT9+cf5Y4kDNtHn9P4AtEDwtcdveUsg= 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; bh=t7ZeigiIOTuiNdOiTV9BljxEaI8RNrOxudQpUPPDEUw=; b=H4P4SGUIkuye2UQ0w247ZBEH5SQpAjauH6V6y30D0DHmJUXzt1+1HDzcDWIYp4FqwK tInULQ+SoOACnokeY5yLTGBP40YHHgHOyWd71MZFW+Ur/9WKw5ojFegBOxH+qdZaJDfN 5Yl/+a3jGjU5cJIVVc/QFbKgA63Ib1ev7dog0yZ/7LHm7zM7WPeWFEh1Ev+6TZk9620Q 4mTRWgE8jUPGsCrc6cVLJn+ALhUKss+f4iKJdu990492ZuCahuHmYhz8OCQmufJsgl+o tK8yrxbwADr+ZZAbHcBuo0ptEhFRedqo9tf8v5nSKny87ngm75v48LofkSlTTC1Ri/TV hGmw== X-Gm-Message-State: ALoCoQkYyMVxpc8de58tc9wovXCo7L197xE4/jTPRSlOK7met2uqwsTJLeWBxMTMsO+dfy6d/1hRw2bSPcTSXr4zeihXY5cR7KKuUILtO/+IRQBgN3L70GR4ItjTSX1L1Ix2fAQ6BUNS6a9jGp10uCwNjrqiN6Ane2PiMgvKK7C8PNMUnl0vS/0Vjv22KNbWKpb+0KgFU7y8 X-Received: by 10.112.160.98 with SMTP id xj2mr34555526lbb.124.1442470679237; Wed, 16 Sep 2015 23:17:59 -0700 (PDT) Received: from localhost.localdomain ([91.198.246.8]) by smtp.gmail.com with ESMTPSA id y7sm283969lay.3.2015.09.16.23.17.58 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Sep 2015 23:17:58 -0700 (PDT) From: Janusz Dziedzic To: ath10k@lists.infradead.org Subject: [PATCH] ath10k: fix MSI-X registering for qca99x0 Date: Thu, 17 Sep 2015 08:17:33 +0200 Message-Id: <1442470653-25162-1-git-send-email-janusz.dziedzic@tieto.com> X-Mailer: git-send-email 1.9.1 X-DomainID: tieto.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150916_231821_496097_5E778FFC X-CRM114-Status: GOOD ( 13.08 ) X-Spam-Score: 0.6 (/) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Janusz Dziedzic , linux-wireless@vger.kernel.org MIME-Version: 1.0 Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RCVD_IN_SBL_CSS,T_DKIM_INVALID,T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP In case of qca99x0 and MSI-X supported/enabled we failed during interrupts registering with message: ath10k_pci 0000:04:00.0: failed to request MSI-X ce irq 50: -22 Issue/fix was reproduced/tested using Dell Latitude E6430 laptop. Signed-off-by: Janusz Dziedzic --- drivers/net/wireless/ath/ath10k/hw.h | 10 ---------- drivers/net/wireless/ath/ath10k/pci.c | 18 +++++------------- 2 files changed, 5 insertions(+), 23 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/hw.h b/drivers/net/wireless/ath/ath10k/hw.h index 23afcda..bc421a5 100644 --- a/drivers/net/wireless/ath/ath10k/hw.h +++ b/drivers/net/wireless/ath/ath10k/hw.h @@ -414,16 +414,6 @@ enum ath10k_hw_rate_cck { #define CE_COUNT ar->hw_values->ce_count /* - * Total number of PCIe MSI interrupts requested for all interrupt sources. - * PCIe standard forces this to be a power of 2. - * Some Host OS's limit MSI requests that can be granted to 8 - * so for now we abide by this limit and avoid requesting more - * than that. - */ -#define MSI_NUM_REQUEST_LOG2 3 -#define MSI_NUM_REQUEST (1<num_msi_intrs = MSI_NUM_REQUEST; + ar_pci->num_msi_intrs = MSI_ASSIGN_CE_MAX + 1; ret = pci_enable_msi_range(ar_pci->pdev, ar_pci->num_msi_intrs, ar_pci->num_msi_intrs); if (ret > 0) @@ -2705,18 +2702,13 @@ static int ath10k_pci_deinit_irq(struct ath10k *ar) switch (ar_pci->num_msi_intrs) { case 0: ath10k_pci_deinit_irq_legacy(ar); - return 0; - case 1: - /* fall-through */ - case MSI_NUM_REQUEST: - pci_disable_msi(ar_pci->pdev); - return 0; + break; default: pci_disable_msi(ar_pci->pdev); + break; } - ath10k_warn(ar, "unknown irq configuration upon deinit\n"); - return -EINVAL; + return 0; } static int ath10k_pci_wait_for_target_init(struct ath10k *ar)