From: Christoph Hellwig <hch@lst.de> Date: 2017-01-09 20:37:44
I had hope that we could kill these old interfaces of for 4.10-rc,
but as of today Linus tree still has two users:
(1) the cobalt media driver, for which I sent a patch long time ago,
it got missed in the merge window.
(2) the new xgbe driver was merged in 4.10-rc but used the old interfaces
anyway
This series resend the patch for (1) and adds a new one for (2), as well
as having the final removal patch behind it. Maybe we should just queue
up all three together in the PCI tree for 4.11?
From: Christoph Hellwig <hch@lst.de> Date: 2017-01-09 20:37:47
Simply the interrupt setup by using the new PCI layer helpers.
Despite using pci_enable_msi_range, this driver was only requesting a
single MSI vector anyway.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/media/pci/cobalt/cobalt-driver.c | 8 ++------
drivers/media/pci/cobalt/cobalt-driver.h | 2 --
2 files changed, 2 insertions(+), 8 deletions(-)
From: Christoph Hellwig <hch@lst.de> Date: 2017-01-09 20:37:58
All multi-MSI allocations are now done through pci_irq_alloc_vectors,
so remove the old interface.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
Documentation/PCI/MSI-HOWTO.txt | 6 ++----
drivers/pci/msi.c | 26 +++++++++-----------------
include/linux/pci.h | 16 ++--------------
3 files changed, 13 insertions(+), 35 deletions(-)
@@ -162,8 +162,6 @@ The following old APIs to enable and disable MSI or MSI-X interrupts should not be used in new code: pci_enable_msi() /* deprecated */- pci_enable_msi_range() /* deprecated */- pci_enable_msi_exact() /* deprecated */ pci_disable_msi() /* deprecated */ pci_enable_msix_range() /* deprecated */ pci_enable_msix_exact() /* deprecated */
@@ -268,5 +266,5 @@ or disabled (0). If 0 is found in any of the msi_bus files belonging to bridges between the PCI root and the device, MSIs are disabled. It is also worth checking the device driver to see whether it supports MSIs.-For example, it may contain calls to pci_enable_msi_range() or-pci_enable_msix_range().+For example, it may contain calls to pci_irq_alloc_vectors with the+PCI_IRQ_MSI or PCI_IRQ_MSIX flags.
@@ -1109,23 +1109,15 @@ static int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec,}}-/**-*pci_enable_msi_range-configuredevice'sMSIcapabilitystructure-*@dev:devicetoconfigure-*@minvec:minimalnumberofinterruptstoconfigure-*@maxvec:maximumnumberofinterruptstoconfigure-*-*Thisfunctiontriestoallocateamaximumpossiblenumberofinterruptsina-*rangebetween@minvecand@maxvec.Itreturnsanegativeerrnoifanerror-*occurs.Ifitsucceeds,itreturnstheactualnumberofinterruptsallocated-*andupdatesthe@dev'sirqmembertothelowestnewinterruptnumber;-*theotherinterruptnumbersallocatedtothisdeviceareconsecutive.-**/-intpci_enable_msi_range(structpci_dev*dev,intminvec,intmaxvec)+/* deprecated, don't use */+intpci_enable_msi(structpci_dev*dev){-return__pci_enable_msi_range(dev,minvec,maxvec,NULL);+intrc=__pci_enable_msi_range(dev,1,1,NULL);+if(rc<0)+returnrc;+return0;}-EXPORT_SYMBOL(pci_enable_msi_range);+EXPORT_SYMBOL(pci_enable_msi);staticint__pci_enable_msix_range(structpci_dev*dev,structmsix_entry*entries,intminvec,
@@ -1381,7 +1373,7 @@ int pci_msi_domain_check_cap(struct irq_domain *domain,{structmsi_desc*desc=first_pci_msi_entry(to_pci_dev(dev));-/* Special handling to support pci_enable_msi_range() */+/* Special handling to support __pci_enable_msi_range() */if(pci_msi_desc_is_multi_msi(desc)&&!(info->flags&MSI_FLAG_MULTI_PCI_MSI))return1;
@@ -1394,7 +1386,7 @@ int pci_msi_domain_check_cap(struct irq_domain *domain,staticintpci_msi_domain_handle_error(structirq_domain*domain,structmsi_desc*desc,interror){-/* Special handling to support pci_enable_msi_range() */+/* Special handling to support __pci_enable_msi_range() */if(pci_msi_desc_is_multi_msi(desc)&&error==-ENOSPC)return1;
From: Tom Lendacky <thomas.lendacky@amd.com> Date: 2017-01-10 18:40:23
On 1/9/2017 2:37 PM, Christoph Hellwig wrote:
The newly added xgbe drivers uses the deprecated pci_enable_msi_exact
and pci_enable_msix_range interfaces. Switch it to use
pci_irq_alloc_vectors instead.
I was just working on switching over to this API with some additional
changes / simplification. I'm ok with using this patch so that you get
the API removal accomplished. Going through the PCI tree just means
it will probably be easier for me to hold off on the additional changes
I wanted to make until later.
Acked-by: Tom Lendacky <thomas.lendacky@amd.com>
From: David Miller <davem@davemloft.net> Date: 2017-01-11 01:20:28
From: Christoph Hellwig <hch@lst.de>
Date: Mon, 9 Jan 2017 21:37:37 +0100
I had hope that we could kill these old interfaces of for 4.10-rc,
but as of today Linus tree still has two users:
(1) the cobalt media driver, for which I sent a patch long time ago,
it got missed in the merge window.
(2) the new xgbe driver was merged in 4.10-rc but used the old interfaces
anyway
This series resend the patch for (1) and adds a new one for (2), as well
as having the final removal patch behind it. Maybe we should just queue
up all three together in the PCI tree for 4.11?
From: Christoph Hellwig <hch@lst.de> Date: 2017-01-11 09:03:59
On Tue, Jan 10, 2017 at 12:40:10PM -0600, Tom Lendacky wrote:
On 1/9/2017 2:37 PM, Christoph Hellwig wrote:
quoted
The newly added xgbe drivers uses the deprecated pci_enable_msi_exact
and pci_enable_msix_range interfaces. Switch it to use
pci_irq_alloc_vectors instead.
I was just working on switching over to this API with some additional
changes / simplification. I'm ok with using this patch so that you get
the API removal accomplished. Going through the PCI tree just means
it will probably be easier for me to hold off on the additional changes
I wanted to make until later.
Hi Tom,
if you have a better patch I'd be more than happy to use that one instead,
this one was intended as a stupid search and replace. The important
part for me is to get the two conversions and the interface removal
in together.
E.g. I've alreayd wondered why the driver requires the exact vector
number for MSI and a variable one for MSI-X, and there certainly is
all kinds of opportunity for cosmetic cleanup.
From: Tom Lendacky <thomas.lendacky@amd.com> Date: 2017-01-11 16:46:52
On 1/11/2017 3:03 AM, Christoph Hellwig wrote:
On Tue, Jan 10, 2017 at 12:40:10PM -0600, Tom Lendacky wrote:
quoted
On 1/9/2017 2:37 PM, Christoph Hellwig wrote:
quoted
The newly added xgbe drivers uses the deprecated pci_enable_msi_exact
and pci_enable_msix_range interfaces. Switch it to use
pci_irq_alloc_vectors instead.
I was just working on switching over to this API with some additional
changes / simplification. I'm ok with using this patch so that you get
the API removal accomplished. Going through the PCI tree just means
it will probably be easier for me to hold off on the additional changes
I wanted to make until later.
Hi Tom,
Hi Christoph,
if you have a better patch I'd be more than happy to use that one instead,
this one was intended as a stupid search and replace. The important
part for me is to get the two conversions and the interface removal
in together.
That sounds good, I'll send the patch to you in a separate email for use
in your series.
Thanks,
Tom
E.g. I've alreayd wondered why the driver requires the exact vector
number for MSI and a variable one for MSI-X, and there certainly is
all kinds of opportunity for cosmetic cleanup.
On Mon, Jan 09, 2017 at 09:37:37PM +0100, Christoph Hellwig wrote:
I had hope that we could kill these old interfaces of for 4.10-rc,
but as of today Linus tree still has two users:
(1) the cobalt media driver, for which I sent a patch long time ago,
it got missed in the merge window.
(2) the new xgbe driver was merged in 4.10-rc but used the old interfaces
anyway
This series resend the patch for (1) and adds a new one for (2), as well
as having the final removal patch behind it. Maybe we should just queue
up all three together in the PCI tree for 4.11?
Applied all three (with Tom's ack on the amd-xgbe patch) to pci/msi for
v4.11, thanks!
From: Christoph Hellwig <hch@lst.de> Date: 2017-01-13 08:05:55
On Fri, Jan 13, 2017 at 08:55:03AM +0100, Christoph Hellwig wrote:
On Thu, Jan 12, 2017 at 03:29:00PM -0600, Bjorn Helgaas wrote:
quoted
Applied all three (with Tom's ack on the amd-xgbe patch) to pci/msi for
v4.11, thanks!
Tom had just send me an event better version of the xgbe patch. Tom,
maybe you can resend that relative to the PCI tree [1], so that we don't
lose it for next merge window?
Actually - Bjorn, your msi branch contains an empty commit from this
thread:
https://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/commit/?h=pci/msi&id=7a8191de43faa9869b421a1b06075d8126ce7c0b
Maybe we should rebase it after all to avoid that? In that case please
pick up the xgbe patch from Tom below:
---
From: Tom Lendacky <thomas.lendacky@amd.com>
Subject: [PATCH] amd-xgbe: Update PCI support to use new IRQ functions
Some of the PCI MSI/MSI-X functions have been deprecated and it is
recommended to use the new pci_alloc_irq_vectors() function. Convert
the code over to use the new function. Also, modify the way in which
the IRQs are requested - try for multiple MSI-X/MSI first, then a
single MSI/legacy interrupt.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/net/ethernet/amd/xgbe/xgbe-pci.c | 128 +++++++++---------------------
drivers/net/ethernet/amd/xgbe/xgbe.h | 8 +-
2 files changed, 41 insertions(+), 95 deletions(-)
On Fri, Jan 13, 2017 at 09:05:53AM +0100, Christoph Hellwig wrote:
On Fri, Jan 13, 2017 at 08:55:03AM +0100, Christoph Hellwig wrote:
quoted
On Thu, Jan 12, 2017 at 03:29:00PM -0600, Bjorn Helgaas wrote:
quoted
Applied all three (with Tom's ack on the amd-xgbe patch) to pci/msi for
v4.11, thanks!
Tom had just send me an event better version of the xgbe patch. Tom,
maybe you can resend that relative to the PCI tree [1], so that we don't
lose it for next merge window?
---
From: Tom Lendacky <thomas.lendacky@amd.com>
Subject: [PATCH] amd-xgbe: Update PCI support to use new IRQ functions
Some of the PCI MSI/MSI-X functions have been deprecated and it is
recommended to use the new pci_alloc_irq_vectors() function. Convert
the code over to use the new function. Also, modify the way in which
the IRQs are requested - try for multiple MSI-X/MSI first, then a
single MSI/legacy interrupt.
Signed-off-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/net/ethernet/amd/xgbe/xgbe-pci.c | 128 +++++++++---------------------
drivers/net/ethernet/amd/xgbe/xgbe.h | 8 +-
2 files changed, 41 insertions(+), 95 deletions(-)