@@ -86,6 +86,14 @@ static inline int pciehp_request_irq(struct controller *ctrl)
init_timer(&ctrl->poll_timer);
start_int_poll_timer(ctrl, 10);
return 0;
+ } else if (irq == -1) {
+ /*
+ * Bail out if there is neither a way to generate
+ * interrupts, nor polling is to be used.
+ */
+ ctrl_err(ctrl,
+ "No way to generate IRQ. Use pciehp_poll_mode\n");
+ return -1;
}
/* Installs the interrupt handler */
@@ -379,10 +379,13 @@ int pcie_port_device_register(struct pci_dev *dev)
/*
* Initialize service irqs. Don't use service devices that
* require interrupts if there is no way to generate them.
+ * However, some drivers (e.g. pciehp) may have a polling mode
+ * that can be used in absense of irqs. Allow them to determine
+ * if that is to be used.
*/
status = init_service_irqs(dev, irqs, capabilities);
if (status) {
- capabilities &= PCIE_PORT_SERVICE_VC;
+ capabilities &= PCIE_PORT_SERVICE_VC | PCIE_PORT_SERVICE_HP;
if (!capabilities)
goto error_disable;
}