Return-path: Received: from mail-ie0-f175.google.com ([209.85.223.175]:52826 "EHLO mail-ie0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751099AbaA2Vob (ORCPT ); Wed, 29 Jan 2014 16:44:31 -0500 Received: by mail-ie0-f175.google.com with SMTP id ar20so2595635iec.6 for ; Wed, 29 Jan 2014 13:44:31 -0800 (PST) Date: Wed, 29 Jan 2014 14:37:16 -0700 From: Bjorn Helgaas To: Alexander Gordeev Cc: linux-kernel@vger.kernel.org, Vladimir Kondratiev , linux-wireless@vger.kernel.org, wil6210@qca.qualcomm.com, linux-pci@vger.kernel.org Subject: Re: [PATCH v2 9/9] wil6210: Use pci_enable_msi_range() Message-ID: <20140129213716.GD16825@google.com> (sfid-20140129_224439_079779_D937C386) References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii In-Reply-To: Sender: linux-wireless-owner@vger.kernel.org List-ID: On Fri, Jan 17, 2014 at 05:02:23PM +0100, Alexander Gordeev wrote: > As result deprecation of MSI-X/MSI enablement functions > pci_enable_msix() and pci_enable_msi_block() all drivers > using these two interfaces need to be updated to use the > new pci_enable_msi_range() and pci_enable_msix_range() > interfaces. > > Signed-off-by: Alexander Gordeev > Acked-by: Vladimir Kondratiev Applied to my pci/msi branch, thanks! > --- > drivers/net/wireless/ath/wil6210/pcie_bus.c | 36 ++++++++++++++------------ > 1 files changed, 19 insertions(+), 17 deletions(-) > > diff --git a/drivers/net/wireless/ath/wil6210/pcie_bus.c b/drivers/net/wireless/ath/wil6210/pcie_bus.c > index eeceab3..4e1bf54 100644 > --- a/drivers/net/wireless/ath/wil6210/pcie_bus.c > +++ b/drivers/net/wireless/ath/wil6210/pcie_bus.c > @@ -41,30 +41,32 @@ static int wil_if_pcie_enable(struct wil6210_priv *wil) > switch (use_msi) { > case 3: > case 1: > + wil_dbg_misc(wil, "Setup %d MSI interrupts\n", use_msi); > + break; > case 0: > + wil_dbg_misc(wil, "MSI interrupts disabled, use INTx\n"); > break; > default: > - wil_err(wil, "Invalid use_msi=%d, default to 1\n", > - use_msi); > + wil_err(wil, "Invalid use_msi=%d, default to 1\n", use_msi); > use_msi = 1; > } > - wil->n_msi = use_msi; > - if (wil->n_msi) { > - wil_dbg_misc(wil, "Setup %d MSI interrupts\n", use_msi); > - rc = pci_enable_msi_block(pdev, wil->n_msi); > - if (rc && (wil->n_msi == 3)) { > - wil_err(wil, "3 MSI mode failed, try 1 MSI\n"); > - wil->n_msi = 1; > - rc = pci_enable_msi_block(pdev, wil->n_msi); > - } > - if (rc) { > - wil_err(wil, "pci_enable_msi failed, use INTx\n"); > - wil->n_msi = 0; > - } > - } else { > - wil_dbg_misc(wil, "MSI interrupts disabled, use INTx\n"); > + > + switch (use_msi) { > + case 3: > + if (pci_enable_msi_range(pdev, 3, 3) > 0) > + break; > + wil_err(wil, "3 MSI mode failed, try 1 MSI\n"); > + use_msi = 1; > + /* fallthrough */ > + case 1: > + if (!pci_enable_msi(pdev)) > + break; > + wil_err(wil, "pci_enable_msi failed, use INTx\n"); > + use_msi = 0; > } > > + wil->n_msi = use_msi; > + > rc = wil6210_init_irq(wil, pdev->irq); > if (rc) > goto stop_master; > -- > 1.7.7.6 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-pci" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html