Commit e87de9d3 authored by Dan Zink's avatar Dan Zink Committed by Greg Kroah-Hartman

[PATCH] Compaq PCI Hotplug bug fix

Found the bug.  The following patch fixes the hot plug
driver so that it has a fallback when there are no unused
IRQs on a system.  At some point intialization got re-
ordered and this was broken.

I found another bug that was preventing the existing scheme from
working.  It looks like the function "pcibios_set_irq_routing" is
returning 1 for success, but the hot plug driver was interpreting it as
failure.
parent dd4f25fb
...@@ -1110,6 +1110,9 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1110,6 +1110,9 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
/* /*
* Get IO, memory, and IRQ resources for new devices * Get IO, memory, and IRQ resources for new devices
*/ */
// The next line is required for cpqhp_find_available_resources
ctrl->interrupt = pdev->irq;
rc = cpqhp_find_available_resources(ctrl, cpqhp_rom_start); rc = cpqhp_find_available_resources(ctrl, cpqhp_rom_start);
ctrl->add_support = !rc; ctrl->add_support = !rc;
if (rc) { if (rc) {
...@@ -1138,7 +1141,6 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -1138,7 +1141,6 @@ static int cpqhpc_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
writel(0xFFFFFFFFL, ctrl->hpc_reg + INT_MASK); writel(0xFFFFFFFFL, ctrl->hpc_reg + INT_MASK);
/* set up the interrupt */ /* set up the interrupt */
ctrl->interrupt = pdev->irq;
dbg("HPC interrupt = %d \n", ctrl->interrupt); dbg("HPC interrupt = %d \n", ctrl->interrupt);
if (request_irq(ctrl->interrupt, if (request_irq(ctrl->interrupt,
(void (*)(int, void *, struct pt_regs *)) &cpqhp_ctrl_intr, (void (*)(int, void *, struct pt_regs *)) &cpqhp_ctrl_intr,
......
...@@ -360,8 +360,8 @@ int cpqhp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num) ...@@ -360,8 +360,8 @@ int cpqhp_set_irq (u8 bus_num, u8 dev_num, u8 int_pin, u8 irq_num)
__FUNCTION__, dev_num, bus_num, int_pin, irq_num); __FUNCTION__, dev_num, bus_num, int_pin, irq_num);
rc = pcibios_set_irq_routing(&fakedev, int_pin - 0x0a, irq_num); rc = pcibios_set_irq_routing(&fakedev, int_pin - 0x0a, irq_num);
dbg("%s: rc %d\n", __FUNCTION__, rc); dbg("%s: rc %d\n", __FUNCTION__, rc);
if (rc) if (!rc)
return rc; return !rc;
// set the Edge Level Control Register (ELCR) // set the Edge Level Control Register (ELCR)
temp_word = inb(0x4d0); temp_word = inb(0x4d0);
......
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