Skip to contentSkip to conversation

block: Use pci_enable_msix_exact() instead of pci_enable_msix()

PATCH Superseded Alexander Gordeev 3 participants 12 messages Feb 26, 2014 – Mar 31, 2014

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

v2 cover block: Use pci_enable_msix_exact() instead of pci_enable_msix()

Changes since v1:
- cciss: patch #1: a weird 'goto' removed;
- cciss: patch #2: pci_enable_msix_exact() used, not pci_enable_msix_range();
- rsxx: patch dropped - no need to change anything;

As result of 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() or pci_enable_msi_exact() and pci_enable_msix_range() or pci_enable_msix_exact() interfaces.

This change updates 'cciss' only, but there is also 'nvme' update pending - I am waiting for Intel guys to clarify if they want to route it thru their tree. If not, I will post the 'nvme' patch as a follow-up to this series.

Thanks!

Alexander Gordeev (2):
cciss: Fallback to MSI rather than to INTx if MSI-X failed
cciss: Use pci_enable_msix_exact() instead of pci_enable_msix()

 drivers/block/cciss.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
Signature · 1 line
1.7.7.6
#1 lore raw

PATCH v2 1/2 cciss: Fallback to MSI rather than to INTx if MSI-X failed

Currently the driver falls back to INTx mode when MSI-X initialization failed. This is a suboptimal behaviour for chips that also support MSI. This update changes that behaviour and falls back to MSI mode in case MSI-X mode initialization failed.

---
 drivers/block/cciss.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/block/cciss.c +0 -2
index 036e8ab..73894ca 100644
@@ -4092,11 +4092,9 @@ static void cciss_interrupt_mode(ctlr_info_t *h)
 		if (err > 0) {
 			dev_warn(&h->pdev->dev,
 				"only %d MSI-X vectors available\n", err);
-			goto default_int_mode;
 		} else {
 			dev_warn(&h->pdev->dev,
 				"MSI-X init failed %d\n", err);
-			goto default_int_mode;
 		}
 	}
 	if (pci_find_capability(h->pdev, PCI_CAP_ID_MSI)) {
Signature · 1 line
1.7.7.6
#2 lore raw

PATCH v2 2/2 cciss: Use pci_enable_msix_exact() instead of pci_enable_msix()

In reply to Alexander Gordeev

As result of 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() or pci_enable_msi_exact() and pci_enable_msix_range() or pci_enable_msix_exact() interfaces.

---
 drivers/block/cciss.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
drivers/block/cciss.c +1 -5
index 73894ca..4595c22 100644
@@ -4080,7 +4080,7 @@ static void cciss_interrupt_mode(ctlr_info_t *h)
 		goto default_int_mode;
 
 	if (pci_find_capability(h->pdev, PCI_CAP_ID_MSIX)) {
-		err = pci_enable_msix(h->pdev, cciss_msix_entries, 4);
+		err = pci_enable_msix_exact(h->pdev, cciss_msix_entries, 4);
 		if (!err) {
 			h->intr[0] = cciss_msix_entries[0].vector;
 			h->intr[1] = cciss_msix_entries[1].vector;
@@ -4088,10 +4088,6 @@ static void cciss_interrupt_mode(ctlr_info_t *h)
 			h->intr[3] = cciss_msix_entries[3].vector;
 			h->msix_vector = 1;
 			return;
-		}
-		if (err > 0) {
-			dev_warn(&h->pdev->dev,
-				"only %d MSI-X vectors available\n", err);
 		} else {
 			dev_warn(&h->pdev->dev,
 				"MSI-X init failed %d\n", err);
Signature · 1 line
1.7.7.6
#3 lore raw

[PATCH v2 3/2] nvme: Use pci_enable_msi_range() and pci_enable_msix_range()

In reply to Alexander Gordeev

As result of 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() or pci_enable_msi_exact() and pci_enable_msix_range() or pci_enable_msix_exact() interfaces.

---
 drivers/block/nvme-core.c |   33 +++++++++------------------------
 1 files changed, 9 insertions(+), 24 deletions(-)
drivers/block/nvme-core.c +9 -24
index 51824d1..eca2b3e 100644
@@ -1837,31 +1837,16 @@ static int nvme_setup_io_queues(struct nvme_dev *dev)
 	/* Deregister the admin queue's interrupt */
 	free_irq(dev->entry[0].vector, adminq);
 
-	vecs = nr_io_queues;
-	for (i = 0; i < vecs; i++)
+	for (i = 0; i < nr_io_queues; i++)
 		dev->entry[i].entry = i;
-	for (;;) {
-		result = pci_enable_msix(pdev, dev->entry, vecs);
-		if (result <= 0)
-			break;
-		vecs = result;
-	}
-
-	if (result < 0) {
-		vecs = nr_io_queues;
-		if (vecs > 32)
-			vecs = 32;
-		for (;;) {
-			result = pci_enable_msi_block(pdev, vecs);
-			if (result == 0) {
-				for (i = 0; i < vecs; i++)
-					dev->entry[i].vector = i + pdev->irq;
-				break;
-			} else if (result < 0) {
-				vecs = 1;
-				break;
-			}
-			vecs = result;
+	vecs = pci_enable_msix_range(pdev, dev->entry, 1, nr_io_queues);
+	if (vecs < 0) {
+		vecs = pci_enable_msi_range(pdev, 1, min(nr_io_queues, 32));
+		if (vecs < 0) {
+			vecs = 1;
+		} else {
+			for (i = 0; i < vecs; i++)
+				dev->entry[i].vector = i + pdev->irq;
 		}
 	}
 
Signature · 6 lines
1.7.7.6

-- 
Regards,
Alexander Gordeev
[email protected]
maintainer
#4 lore raw
In reply to Alexander Gordeev
Quoted 12 lines · Alexander Gordeev

Changes since v1:
- cciss: patch #1: a weird 'goto' removed;
- cciss: patch #2: pci_enable_msix_exact() used, not pci_enable_msix_range();
- rsxx: patch dropped - no need to change anything;

As result of 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() or pci_enable_msi_exact() and pci_enable_msix_range() or pci_enable_msix_exact() interfaces.

Quoted 4 lines

This change updates 'cciss' only, but there is also 'nvme' update pending - I am waiting for Intel guys to clarify if they want to route it thru their tree. If not, I will post the 'nvme' patch as a follow-up to this series.

Hi Jens,

I'd like to get these merged during the v3.15 merge window. I'd be glad to review and apply them through my tree, unless you want to do it. They do depend on f7fc32c, which went in after the v3.14 merge window, which makes it a bit of a hassle.

So let me know if you'd rather handle these; otherwise I'll review them and put them in my tree next week.

I'll include the nvme update, since it has Keith's "Reviewed-by".

Bjorn

Quoted 19 lines

Alexander Gordeev (2):
cciss: Fallback to MSI rather than to INTx if MSI-X failed
cciss: Use pci_enable_msix_exact() instead of pci_enable_msix()

 drivers/block/cciss.c |    8 +-------
 1 files changed, 1 insertions(+), 7 deletions(-)
Signature · 6 lines
1.7.7.6

--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
maintainer
#5 lore raw
Quoted 18 lines · Bjorn Helgaas
Quoted 12 lines · Alexander Gordeev

Changes since v1:
- cciss: patch #1: a weird 'goto' removed;
- cciss: patch #2: pci_enable_msix_exact() used, not pci_enable_msix_range();
- rsxx: patch dropped - no need to change anything;

As result of 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() or pci_enable_msi_exact() and pci_enable_msix_range() or pci_enable_msix_exact() interfaces.

Quoted 4 lines

This change updates 'cciss' only, but there is also 'nvme' update pending - I am waiting for Intel guys to clarify if they want to route it thru their tree. If not, I will post the 'nvme' patch as a follow-up to this series.

Quoted 6 lines

Hi Jens,

I'd like to get these merged during the v3.15 merge window. I'd be glad to review and apply them through my tree, unless you want to do it. They do depend on f7fc32c, which went in after the v3.14 merge window, which makes it a bit of a hassle.

My 3.15/drivers (and core) branch are based off 3.14-rc3, so it should be OK. I've queued them up, as it's mostly a followup to the previous ones from Alexander.

Signature · 1 line
Jens Axboe
maintainer
#6 lore raw
Quoted 32 lines · Jens Axboe
Quoted 22 lines · Bjorn Helgaas
Quoted 14 lines · Alexander Gordeev

Changes since v1:
- cciss: patch #1: a weird 'goto' removed;
- cciss: patch #2: pci_enable_msix_exact() used, not
pci_enable_msix_range();
- rsxx: patch dropped - no need to change anything;

As result of 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() or pci_enable_msi_exact() and pci_enable_msix_range() or pci_enable_msix_exact() interfaces.

Quoted 4 lines

This change updates 'cciss' only, but there is also 'nvme' update pending - I am waiting for Intel guys to clarify if they want to route it thru their tree. If not, I will post the 'nvme' patch as a follow-up to this series.

Quoted 7 lines

Hi Jens,

I'd like to get these merged during the v3.15 merge window. I'd be glad to
review and apply them through my tree, unless you want to do it. They do depend on f7fc32c, which went in after the v3.14 merge window, which makes it a bit of a hassle.

Quoted 3 lines

My 3.15/drivers (and core) branch are based off 3.14-rc3, so it should be OK. I've queued them up, as it's mostly a followup to the previous ones from Alexander.

Great, thanks! I'll take them off my to-do list.

Bjorn

#7 lore raw
In reply to Jens Axboe
Quoted 21 lines · Jens Axboe
Quoted 20 lines · Bjorn Helgaas
Quoted 12 lines · Alexander Gordeev

Changes since v1:
- cciss: patch #1: a weird 'goto' removed;
- cciss: patch #2: pci_enable_msix_exact() used, not pci_enable_msix_range();
- rsxx: patch dropped - no need to change anything;

As result of 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() or pci_enable_msi_exact() and pci_enable_msix_range() or pci_enable_msix_exact() interfaces.

Quoted 4 lines

This change updates 'cciss' only, but there is also 'nvme' update pending - I am waiting for Intel guys to clarify if they want to route it thru their tree. If not, I will post the 'nvme' patch as a follow-up to this series.

Hi Jens,

Quoted 8 lines
Quoted 4 lines

I'd like to get these merged during the v3.15 merge window. I'd be glad to review and apply them through my tree, unless you want to do it. They do depend on f7fc32c, which went in after the v3.14 merge window, which makes it a bit of a hassle.

My 3.15/drivers (and core) branch are based off 3.14-rc3, so it should be OK. I've queued them up, as it's mostly a followup to the previous ones from Alexander.

Oh-oh, cciss patch #2 requires commit 3ce4e86 ("PCI/MSI: Add pci_enable_msi_exact() and pci_enable_msix_exact()") which was pulled to 3.14-rc4 only. Sorry for failing to clarify that :(

And I also notice 3111cc3 ("skd: Use pci_enable_msix_exact() instead of pci_enable_msix_range()") in your tree also should not compile :(

Quoted 3 lines
Signature · 1 line
Jens Axboe
Signature · 3 lines
Regards,
Alexander Gordeev
[email protected]
maintainer
#8 lore raw
Quoted 31 lines · Alexander Gordeev
Quoted 21 lines · Jens Axboe
Quoted 20 lines · Bjorn Helgaas
Quoted 12 lines · Alexander Gordeev

Changes since v1:
- cciss: patch #1: a weird 'goto' removed;
- cciss: patch #2: pci_enable_msix_exact() used, not pci_enable_msix_range();
- rsxx: patch dropped - no need to change anything;

As result of 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() or pci_enable_msi_exact() and pci_enable_msix_range() or pci_enable_msix_exact() interfaces.

Quoted 4 lines

This change updates 'cciss' only, but there is also 'nvme' update pending - I am waiting for Intel guys to clarify if they want to route it thru their tree. If not, I will post the 'nvme' patch as a follow-up to this series.

Hi Jens,

Quoted 8 lines
Quoted 4 lines

I'd like to get these merged during the v3.15 merge window. I'd be glad to review and apply them through my tree, unless you want to do it. They do depend on f7fc32c, which went in after the v3.14 merge window, which makes it a bit of a hassle.

My 3.15/drivers (and core) branch are based off 3.14-rc3, so it should be OK. I've queued them up, as it's mostly a followup to the previous ones from Alexander.

Quoted 6 lines

Oh-oh, cciss patch #2 requires commit 3ce4e86 ("PCI/MSI: Add pci_enable_msi_exact() and pci_enable_msix_exact()") which was pulled to 3.14-rc4 only. Sorry for failing to clarify that :(

And I also notice 3111cc3 ("skd: Use pci_enable_msix_exact() instead of pci_enable_msix_range()") in your tree also should not compile :(

Gah, please be a bit more diligent in the future, that's a lot of breakage for a small series. If it's this broken, I'll have to rebase the branch, which I attempt to never do for the "official" branches.

Signature · 1 line
Jens Axboe
#9 lore raw
In reply to Alexander Gordeev
Quoted 6 lines · Alexander Gordeev

Oh-oh, cciss patch #2 requires commit 3ce4e86 ("PCI/MSI: Add pci_enable_msi_exact() and pci_enable_msix_exact()") which was pulled to 3.14-rc4 only. Sorry for failing to clarify that :(

And I also notice 3111cc3 ("skd: Use pci_enable_msix_exact() instead of pci_enable_msix_range()") in your tree also should not compile :(

Hi Jens,

3.14 contains prerequisite commits for the patches above. Would you pull them or do you want me to resend the two?

Thanks!

Signature · 3 lines
Regards,
Alexander Gordeev
[email protected]
maintainer
#10 lore raw
Quoted 5 lines · Alexander Gordeev
Quoted 4 lines · Alexander Gordeev

Oh-oh, cciss patch #2 requires commit 3ce4e86 ("PCI/MSI: Add pci_enable_msi_exact() and pci_enable_msix_exact()") which was pulled to 3.14-rc4 only. Sorry for failing to clarify that :(

Quoted 7 lines
Quoted 2 lines

And I also notice 3111cc3 ("skd: Use pci_enable_msix_exact() instead of pci_enable_msix_range()") in your tree also should not compile :(

Hi Jens,

3.14 contains prerequisite commits for the patches above. Would you pull them or do you want me to resend the two?

I'm assuming you are referring to the cciss patches? I can add those back, for a post-merge pull request.

Signature · 1 line
Jens Axboe
#11 lore raw
Quoted 9 lines · Jens Axboe
Quoted 8 lines · Alexander Gordeev
Quoted 6 lines · Alexander Gordeev

Oh-oh, cciss patch #2 requires commit 3ce4e86 ("PCI/MSI: Add pci_enable_msi_exact() and pci_enable_msix_exact()") which was pulled to 3.14-rc4 only. Sorry for failing to clarify that :(

And I also notice 3111cc3 ("skd: Use pci_enable_msix_exact() instead of pci_enable_msix_range()") in your tree also should not compile :(

Quoted 7 lines
Quoted 4 lines

Hi Jens,

3.14 contains prerequisite commits for the patches above. Would you pull them or do you want me to resend the two?

I'm assuming you are referring to the cciss patches? I can add those back, for a post-merge pull request.

Nope. You kicked off the second of two 'cciss' patch ("PCI/MSI: Add pci_enable_msi_exact() and pci_enable_msix_exact()") and the last one from a series I posted in another thread ("skd: Use pci_enable_msix_exact() instead of pci_enable_msix_range()").

Quoted 4 lines
Signature · 2 lines
-- 
Jens Axboe
Signature · 3 lines
Regards,
Alexander Gordeev
[email protected]