Commit 4fe03955 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Bjorn Helgaas

PCI/MSI: Remove pci_enable_msi_{exact,range}()

All multi-MSI allocations are now done through pci_irq_alloc_vectors(), so
remove the old pci_enable_msi_range() and pci_enable_msi_exact()
interfaces.
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
parent e7537740
...@@ -162,8 +162,6 @@ The following old APIs to enable and disable MSI or MSI-X interrupts should ...@@ -162,8 +162,6 @@ The following old APIs to enable and disable MSI or MSI-X interrupts should
not be used in new code: not be used in new code:
pci_enable_msi() /* deprecated */ pci_enable_msi() /* deprecated */
pci_enable_msi_range() /* deprecated */
pci_enable_msi_exact() /* deprecated */
pci_disable_msi() /* deprecated */ pci_disable_msi() /* deprecated */
pci_enable_msix_range() /* deprecated */ pci_enable_msix_range() /* deprecated */
pci_enable_msix_exact() /* 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 ...@@ -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. 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. 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 For example, it may contain calls to pci_irq_alloc_vectors() with the
pci_enable_msix_range(). 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, ...@@ -1109,23 +1109,15 @@ static int __pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec,
} }
} }
/** /* deprecated, don't use */
* pci_enable_msi_range - configure device's MSI capability structure int pci_enable_msi(struct pci_dev *dev)
* @dev: device to configure
* @minvec: minimal number of interrupts to configure
* @maxvec: maximum number of interrupts to configure
*
* This function tries to allocate a maximum possible number of interrupts in a
* range between @minvec and @maxvec. It returns a negative errno if an error
* occurs. If it succeeds, it returns the actual number of interrupts allocated
* and updates the @dev's irq member to the lowest new interrupt number;
* the other interrupt numbers allocated to this device are consecutive.
**/
int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec)
{ {
return __pci_enable_msi_range(dev, minvec, maxvec, NULL); int rc = __pci_enable_msi_range(dev, 1, 1, NULL);
if (rc < 0)
return rc;
return 0;
} }
EXPORT_SYMBOL(pci_enable_msi_range); EXPORT_SYMBOL(pci_enable_msi);
static int __pci_enable_msix_range(struct pci_dev *dev, static int __pci_enable_msix_range(struct pci_dev *dev,
struct msix_entry *entries, int minvec, struct msix_entry *entries, int minvec,
...@@ -1381,7 +1373,7 @@ int pci_msi_domain_check_cap(struct irq_domain *domain, ...@@ -1381,7 +1373,7 @@ int pci_msi_domain_check_cap(struct irq_domain *domain,
{ {
struct msi_desc *desc = first_pci_msi_entry(to_pci_dev(dev)); struct msi_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) && if (pci_msi_desc_is_multi_msi(desc) &&
!(info->flags & MSI_FLAG_MULTI_PCI_MSI)) !(info->flags & MSI_FLAG_MULTI_PCI_MSI))
return 1; return 1;
...@@ -1394,7 +1386,7 @@ int pci_msi_domain_check_cap(struct irq_domain *domain, ...@@ -1394,7 +1386,7 @@ int pci_msi_domain_check_cap(struct irq_domain *domain,
static int pci_msi_domain_handle_error(struct irq_domain *domain, static int pci_msi_domain_handle_error(struct irq_domain *domain,
struct msi_desc *desc, int error) struct msi_desc *desc, int error)
{ {
/* 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) if (pci_msi_desc_is_multi_msi(desc) && error == -ENOSPC)
return 1; return 1;
......
...@@ -1309,14 +1309,7 @@ void pci_msix_shutdown(struct pci_dev *dev); ...@@ -1309,14 +1309,7 @@ void pci_msix_shutdown(struct pci_dev *dev);
void pci_disable_msix(struct pci_dev *dev); void pci_disable_msix(struct pci_dev *dev);
void pci_restore_msi_state(struct pci_dev *dev); void pci_restore_msi_state(struct pci_dev *dev);
int pci_msi_enabled(void); int pci_msi_enabled(void);
int pci_enable_msi_range(struct pci_dev *dev, int minvec, int maxvec); int pci_enable_msi(struct pci_dev *dev);
static inline int pci_enable_msi_exact(struct pci_dev *dev, int nvec)
{
int rc = pci_enable_msi_range(dev, nvec, nvec);
if (rc < 0)
return rc;
return 0;
}
int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries, int pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries,
int minvec, int maxvec); int minvec, int maxvec);
static inline int pci_enable_msix_exact(struct pci_dev *dev, static inline int pci_enable_msix_exact(struct pci_dev *dev,
...@@ -1347,10 +1340,7 @@ static inline void pci_msix_shutdown(struct pci_dev *dev) { } ...@@ -1347,10 +1340,7 @@ static inline void pci_msix_shutdown(struct pci_dev *dev) { }
static inline void pci_disable_msix(struct pci_dev *dev) { } static inline void pci_disable_msix(struct pci_dev *dev) { }
static inline void pci_restore_msi_state(struct pci_dev *dev) { } static inline void pci_restore_msi_state(struct pci_dev *dev) { }
static inline int pci_msi_enabled(void) { return 0; } static inline int pci_msi_enabled(void) { return 0; }
static inline int pci_enable_msi_range(struct pci_dev *dev, int minvec, static inline int pci_enable_msi(struct pci_dev *dev)
int maxvec)
{ return -ENOSYS; }
static inline int pci_enable_msi_exact(struct pci_dev *dev, int nvec)
{ return -ENOSYS; } { return -ENOSYS; }
static inline int pci_enable_msix_range(struct pci_dev *dev, static inline int pci_enable_msix_range(struct pci_dev *dev,
struct msix_entry *entries, int minvec, int maxvec) struct msix_entry *entries, int minvec, int maxvec)
...@@ -1426,8 +1416,6 @@ static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { } ...@@ -1426,8 +1416,6 @@ static inline void pcie_set_ecrc_checking(struct pci_dev *dev) { }
static inline void pcie_ecrc_get_policy(char *str) { } static inline void pcie_ecrc_get_policy(char *str) { }
#endif #endif
#define pci_enable_msi(pdev) pci_enable_msi_exact(pdev, 1)
#ifdef CONFIG_HT_IRQ #ifdef CONFIG_HT_IRQ
/* The functions a driver should call */ /* The functions a driver should call */
int ht_create_irq(struct pci_dev *dev, int idx); int ht_create_irq(struct pci_dev *dev, int idx);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment