Merge branch 'pci/portdrv'
- Don't setup portdrv IRQs if there are no port drivers that use them, to conserve vectors and avoid spurious events (Jan Kiszka) * pci/portdrv: PCI/portdrv: Do not setup up IRQs if there are no users
This commit is contained in:
commit
357cf0cddd
@ -166,9 +166,6 @@ static int pcie_init_service_irqs(struct pci_dev *dev, int *irqs, int mask)
|
|||||||
{
|
{
|
||||||
int ret, i;
|
int ret, i;
|
||||||
|
|
||||||
for (i = 0; i < PCIE_PORT_DEVICE_MAXSERVICES; i++)
|
|
||||||
irqs[i] = -1;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* If we support PME but can't use MSI/MSI-X for it, we have to
|
* If we support PME but can't use MSI/MSI-X for it, we have to
|
||||||
* fall back to INTx or other interrupts, e.g., a system shared
|
* fall back to INTx or other interrupts, e.g., a system shared
|
||||||
@ -317,8 +314,10 @@ static int pcie_device_init(struct pci_dev *pdev, int service, int irq)
|
|||||||
*/
|
*/
|
||||||
int pcie_port_device_register(struct pci_dev *dev)
|
int pcie_port_device_register(struct pci_dev *dev)
|
||||||
{
|
{
|
||||||
int status, capabilities, i, nr_service;
|
int status, capabilities, irq_services, i, nr_service;
|
||||||
int irqs[PCIE_PORT_DEVICE_MAXSERVICES];
|
int irqs[PCIE_PORT_DEVICE_MAXSERVICES] = {
|
||||||
|
[0 ... PCIE_PORT_DEVICE_MAXSERVICES-1] = -1
|
||||||
|
};
|
||||||
|
|
||||||
/* Enable PCI Express port device */
|
/* Enable PCI Express port device */
|
||||||
status = pci_enable_device(dev);
|
status = pci_enable_device(dev);
|
||||||
@ -331,18 +330,32 @@ int pcie_port_device_register(struct pci_dev *dev)
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
pci_set_master(dev);
|
pci_set_master(dev);
|
||||||
/*
|
|
||||||
* Initialize service irqs. Don't use service devices that
|
irq_services = 0;
|
||||||
* require interrupts if there is no way to generate them.
|
if (IS_ENABLED(CONFIG_PCIE_PME))
|
||||||
* However, some drivers may have a polling mode (e.g. pciehp_poll_mode)
|
irq_services |= PCIE_PORT_SERVICE_PME;
|
||||||
* that can be used in the absence of irqs. Allow them to determine
|
if (IS_ENABLED(CONFIG_PCIEAER))
|
||||||
* if that is to be used.
|
irq_services |= PCIE_PORT_SERVICE_AER;
|
||||||
*/
|
if (IS_ENABLED(CONFIG_HOTPLUG_PCI_PCIE))
|
||||||
status = pcie_init_service_irqs(dev, irqs, capabilities);
|
irq_services |= PCIE_PORT_SERVICE_HP;
|
||||||
if (status) {
|
if (IS_ENABLED(CONFIG_PCIE_DPC))
|
||||||
capabilities &= PCIE_PORT_SERVICE_HP;
|
irq_services |= PCIE_PORT_SERVICE_DPC;
|
||||||
if (!capabilities)
|
irq_services &= capabilities;
|
||||||
goto error_disable;
|
|
||||||
|
if (irq_services) {
|
||||||
|
/*
|
||||||
|
* Initialize service IRQs. Don't use service devices that
|
||||||
|
* require interrupts if there is no way to generate them.
|
||||||
|
* However, some drivers may have a polling mode (e.g.
|
||||||
|
* pciehp_poll_mode) that can be used in the absence of IRQs.
|
||||||
|
* Allow them to determine if that is to be used.
|
||||||
|
*/
|
||||||
|
status = pcie_init_service_irqs(dev, irqs, irq_services);
|
||||||
|
if (status) {
|
||||||
|
irq_services &= PCIE_PORT_SERVICE_HP;
|
||||||
|
if (!irq_services)
|
||||||
|
goto error_disable;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Allocate child services if any */
|
/* Allocate child services if any */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user