Linux wireless drivers development
 help / color / mirror / Atom feed
* [PATCH 0/7] Phase out pci_enable_msi_block()
@ 2014-01-07 18:05 Alexander Gordeev
  2014-01-07 18:05 ` [PATCH 6/7] ath10k: Use new interfaces for MSI enablement Alexander Gordeev
  2014-01-07 18:05 ` [PATCH 7/7] wil6210: " Alexander Gordeev
  0 siblings, 2 replies; 10+ messages in thread
From: Alexander Gordeev @ 2014-01-07 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Brian King, Tejun Heo, Matthew Wilcox,
	Alex Williamson, Kalle Valo, Vladimir Kondratiev, linux-wireless,
	wil6210, ath10k, linux-nvme, linux-ide, linux-scsi, kvm,
	linux-pci

As result of recent deprecation of MSI-X/MSI enablement
interfaces pci_enable_msi_block(), pci_enable_msi() and
pci_enable_msix() all drivers need to be updated to use
new pci_enable_msi_range() and pci_enable_msix_range()
interfaces.

This is the first in a series of updates, to phase out
pci_enable_msi_block() function.

This series is against pci/msi branch in Bjorn Helgaas's repo:
git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git

Thanks!

Alexander Gordeev (7):
  ipr: Do not call pci_disable_msi/msix() if pci_enable_msi/msix()
    failed
  ipr: Use new interfaces for MSI/MSI-X enablement
  ahci: Use new interfaces for MSI/MSI-X enablement
  nvme: Use new interfaces for MSI/MSI-X enablement
  vfio: Use new interfaces for MSI/MSI-X enablement
  ath10k: Use new interfaces for MSI enablement
  wil6210: Use new interfaces for MSI enablement

 drivers/ata/ahci.c                          |   15 +++-----
 drivers/block/nvme-core.c                   |   33 ++++-------------
 drivers/net/wireless/ath/ath10k/pci.c       |   22 ++++++------
 drivers/net/wireless/ath/wil6210/pcie_bus.c |   36 ++++++++++---------
 drivers/scsi/ipr.c                          |   51 +++++++++-----------------
 drivers/vfio/pci/vfio_pci_intrs.c           |    8 ++--
 6 files changed, 66 insertions(+), 99 deletions(-)

-- 
1.7.7.6


^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 6/7] ath10k: Use new interfaces for MSI enablement
  2014-01-07 18:05 [PATCH 0/7] Phase out pci_enable_msi_block() Alexander Gordeev
@ 2014-01-07 18:05 ` Alexander Gordeev
  2014-01-08  8:23   ` Kalle Valo
  2014-01-07 18:05 ` [PATCH 7/7] wil6210: " Alexander Gordeev
  1 sibling, 1 reply; 10+ messages in thread
From: Alexander Gordeev @ 2014-01-07 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Kalle Valo, linux-wireless, ath10k, linux-pci

This update also fixes a stylistic (naming and messaging only)
confusion of MSI-X vs multiple MSIs which are not the same.

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
---
 drivers/net/wireless/ath/ath10k/pci.c |   22 +++++++++++-----------
 1 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/net/wireless/ath/ath10k/pci.c b/drivers/net/wireless/ath/ath10k/pci.c
index 9e86a81..08807fe 100644
--- a/drivers/net/wireless/ath/ath10k/pci.c
+++ b/drivers/net/wireless/ath/ath10k/pci.c
@@ -2073,14 +2073,14 @@ static void ath10k_pci_tasklet(unsigned long data)
 	}
 }
 
-static int ath10k_pci_start_intr_msix(struct ath10k *ar, int num)
+static int ath10k_pci_start_intr_multi_msi(struct ath10k *ar, int num)
 {
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
 	int ret;
 	int i;
 
-	ret = pci_enable_msi_block(ar_pci->pdev, num);
-	if (ret)
+	ret = pci_enable_msi_range(ar_pci->pdev, num, num);
+	if (ret < 0)
 		return ret;
 
 	ret = request_irq(ar_pci->pdev->irq + MSI_ASSIGN_FW,
@@ -2111,16 +2111,16 @@ static int ath10k_pci_start_intr_msix(struct ath10k *ar, int num)
 		}
 	}
 
-	ath10k_info("MSI-X interrupt handling (%d intrs)\n", num);
+	ath10k_info("Multi MSI interrupt handling (%d intrs)\n", num);
 	return 0;
 }
 
-static int ath10k_pci_start_intr_msi(struct ath10k *ar)
+static int ath10k_pci_start_intr_single_msi(struct ath10k *ar)
 {
 	struct ath10k_pci *ar_pci = ath10k_pci_priv(ar);
 	int ret;
 
-	ret = pci_enable_msi(ar_pci->pdev);
+	ret = pci_enable_msi_range(ar_pci->pdev, 1, 1);
 	if (ret < 0)
 		return ret;
 
@@ -2132,7 +2132,7 @@ static int ath10k_pci_start_intr_msi(struct ath10k *ar)
 		return ret;
 	}
 
-	ath10k_info("MSI interrupt handling\n");
+	ath10k_info("Single MSI interrupt handling\n");
 	return 0;
 }
 
@@ -2199,20 +2199,20 @@ static int ath10k_pci_start_intr(struct ath10k *ar)
 		num = 1;
 
 	if (num > 1) {
-		ret = ath10k_pci_start_intr_msix(ar, num);
+		ret = ath10k_pci_start_intr_multi_msi(ar, num);
 		if (ret == 0)
 			goto exit;
 
-		ath10k_warn("MSI-X didn't succeed (%d), trying MSI\n", ret);
+		ath10k_warn("Multi MSI failed (%d), trying single MSI\n", ret);
 		num = 1;
 	}
 
 	if (num == 1) {
-		ret = ath10k_pci_start_intr_msi(ar);
+		ret = ath10k_pci_start_intr_single_msi(ar);
 		if (ret == 0)
 			goto exit;
 
-		ath10k_warn("MSI didn't succeed (%d), trying legacy INTR\n",
+		ath10k_warn("Single MSI failed (%d), trying legacy INTR\n",
 			    ret);
 		num = 0;
 	}
-- 
1.7.7.6


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 7/7] wil6210: Use new interfaces for MSI enablement
  2014-01-07 18:05 [PATCH 0/7] Phase out pci_enable_msi_block() Alexander Gordeev
  2014-01-07 18:05 ` [PATCH 6/7] ath10k: Use new interfaces for MSI enablement Alexander Gordeev
@ 2014-01-07 18:05 ` Alexander Gordeev
  2014-01-08 11:30   ` Vladimir Kondratiev
  1 sibling, 1 reply; 10+ messages in thread
From: Alexander Gordeev @ 2014-01-07 18:05 UTC (permalink / raw)
  To: linux-kernel
  Cc: Alexander Gordeev, Vladimir Kondratiev, linux-wireless, wil6210,
	linux-pci

Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
---
 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..022dfe4 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_range(pdev, 1, 1) > 0)
+			break;
+		wil_err(wil, "pci_enable_msi_range 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


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 6/7] ath10k: Use new interfaces for MSI enablement
  2014-01-07 18:05 ` [PATCH 6/7] ath10k: Use new interfaces for MSI enablement Alexander Gordeev
@ 2014-01-08  8:23   ` Kalle Valo
  2014-01-08  9:04     ` Alexander Gordeev
  0 siblings, 1 reply; 10+ messages in thread
From: Kalle Valo @ 2014-01-08  8:23 UTC (permalink / raw)
  To: Alexander Gordeev; +Cc: linux-kernel, linux-wireless, ath10k, linux-pci

Alexander Gordeev <agordeev@redhat.com> writes:

> This update also fixes a stylistic (naming and messaging only)
> confusion of MSI-X vs multiple MSIs which are not the same.
>
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>

Looks good to me.

Acked-by: Kalle Valo <kvalo@qca.qualcomm.com>

Do you want me to take this patch to my ath.git tree or how were you
planning to handle it?

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 6/7] ath10k: Use new interfaces for MSI enablement
  2014-01-08  8:23   ` Kalle Valo
@ 2014-01-08  9:04     ` Alexander Gordeev
  2014-01-08 12:44       ` Kalle Valo
  0 siblings, 1 reply; 10+ messages in thread
From: Alexander Gordeev @ 2014-01-08  9:04 UTC (permalink / raw)
  To: Kalle Valo; +Cc: linux-kernel, linux-wireless, ath10k, linux-pci

On Wed, Jan 08, 2014 at 10:23:18AM +0200, Kalle Valo wrote:
> Looks good to me.
> 
> Acked-by: Kalle Valo <kvalo@qca.qualcomm.com>

Thanks, Kalle.

> Do you want me to take this patch to my ath.git tree or how were you
> planning to handle it?

I see no option other than pushing it thru pci.git tree at this stage.

> -- 
> Kalle Valo

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 7/7] wil6210: Use new interfaces for MSI enablement
  2014-01-07 18:05 ` [PATCH 7/7] wil6210: " Alexander Gordeev
@ 2014-01-08 11:30   ` Vladimir Kondratiev
  2014-01-08 11:54     ` Alexander Gordeev
  0 siblings, 1 reply; 10+ messages in thread
From: Vladimir Kondratiev @ 2014-01-08 11:30 UTC (permalink / raw)
  To: Alexander Gordeev; +Cc: linux-kernel, linux-wireless, wil6210, linux-pci

On Tuesday, January 07, 2014 07:05:42 PM Alexander Gordeev wrote:
> Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> ---
>  drivers/net/wireless/ath/wil6210/pcie_bus.c |   36 ++++++++++++++------------
>  1 files changed, 19 insertions(+), 17 deletions(-)
> 

Patch looks fine, but I can't validate it as I can't find patch introducing
pci_enable_msi_range(). Where this patch landed on?

I am working with:
git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git

I also checked
git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
and, of course
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

Thanks, Vladimir

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 7/7] wil6210: Use new interfaces for MSI enablement
  2014-01-08 11:30   ` Vladimir Kondratiev
@ 2014-01-08 11:54     ` Alexander Gordeev
  2014-01-08 12:19       ` Vladimir Kondratiev
  0 siblings, 1 reply; 10+ messages in thread
From: Alexander Gordeev @ 2014-01-08 11:54 UTC (permalink / raw)
  To: Vladimir Kondratiev; +Cc: linux-kernel, linux-wireless, wil6210, linux-pci

On Wed, Jan 08, 2014 at 01:30:45PM +0200, Vladimir Kondratiev wrote:
> On Tuesday, January 07, 2014 07:05:42 PM Alexander Gordeev wrote:
> > Signed-off-by: Alexander Gordeev <agordeev@redhat.com>
> > ---
> >  drivers/net/wireless/ath/wil6210/pcie_bus.c |   36 ++++++++++++++------------
> >  1 files changed, 19 insertions(+), 17 deletions(-)
> > 
> 
> Patch looks fine, but I can't validate it as I can't find patch introducing
> pci_enable_msi_range(). Where this patch landed on?

Vladimir,

This series is against pci/msi branch in Bjorn Helgaas's repo:
git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git

Commit 302a252 "PCI/MSI: Add pci_enable_msi_range() and pci_enable_msix_range()"

> I am working with:
> git://git.kernel.org/pub/scm/linux/kernel/git/linville/wireless-testing.git
> 
> I also checked
> git://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
> and, of course
> git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
> 
> Thanks, Vladimir

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 7/7] wil6210: Use new interfaces for MSI enablement
  2014-01-08 11:54     ` Alexander Gordeev
@ 2014-01-08 12:19       ` Vladimir Kondratiev
  2014-01-08 12:34         ` Alexander Gordeev
  0 siblings, 1 reply; 10+ messages in thread
From: Vladimir Kondratiev @ 2014-01-08 12:19 UTC (permalink / raw)
  To: Alexander Gordeev; +Cc: linux-kernel, linux-wireless, wil6210, linux-pci

On Wednesday, January 08, 2014 12:54:01 PM Alexander Gordeev wrote:
> Vladimir,
> 
> This series is against pci/msi branch in Bjorn Helgaas's repo:
> git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git
> 
> Commit 302a252 "PCI/MSI: Add pci_enable_msi_range() and pci_enable_msix_range()"
> 

Thanks, see it. New code don't distinguish between negative and positive error
values, same as old code. I'll fix it.

Meanwhile, below my

Acked-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 7/7] wil6210: Use new interfaces for MSI enablement
  2014-01-08 12:19       ` Vladimir Kondratiev
@ 2014-01-08 12:34         ` Alexander Gordeev
  0 siblings, 0 replies; 10+ messages in thread
From: Alexander Gordeev @ 2014-01-08 12:34 UTC (permalink / raw)
  To: Vladimir Kondratiev; +Cc: linux-kernel, linux-wireless, wil6210, linux-pci

On Wed, Jan 08, 2014 at 02:19:01PM +0200, Vladimir Kondratiev wrote:
> Thanks, see it. New code don't distinguish between negative and positive error
> values, same as old code. I'll fix it.

As the patch seems okay for you, I am not quite getting what else needs
to be fixed? :)

> Meanwhile, below my
> 
> Acked-by: Vladimir Kondratiev <qca_vkondrat@qca.qualcomm.com>

Thanks, Vladimir!

-- 
Regards,
Alexander Gordeev
agordeev@redhat.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 6/7] ath10k: Use new interfaces for MSI enablement
  2014-01-08  9:04     ` Alexander Gordeev
@ 2014-01-08 12:44       ` Kalle Valo
  0 siblings, 0 replies; 10+ messages in thread
From: Kalle Valo @ 2014-01-08 12:44 UTC (permalink / raw)
  To: Alexander Gordeev; +Cc: linux-pci, linux-wireless, linux-kernel, ath10k

Alexander Gordeev <agordeev@redhat.com> writes:

> On Wed, Jan 08, 2014 at 10:23:18AM +0200, Kalle Valo wrote:
>
>> Do you want me to take this patch to my ath.git tree or how were you
>> planning to handle it?
>
> I see no option other than pushing it thru pci.git tree at this stage.

Thanks, I'll then just drop it from my queue.

-- 
Kalle Valo

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2014-01-08 12:45 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-01-07 18:05 [PATCH 0/7] Phase out pci_enable_msi_block() Alexander Gordeev
2014-01-07 18:05 ` [PATCH 6/7] ath10k: Use new interfaces for MSI enablement Alexander Gordeev
2014-01-08  8:23   ` Kalle Valo
2014-01-08  9:04     ` Alexander Gordeev
2014-01-08 12:44       ` Kalle Valo
2014-01-07 18:05 ` [PATCH 7/7] wil6210: " Alexander Gordeev
2014-01-08 11:30   ` Vladimir Kondratiev
2014-01-08 11:54     ` Alexander Gordeev
2014-01-08 12:19       ` Vladimir Kondratiev
2014-01-08 12:34         ` Alexander Gordeev

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox