Skip to contentSkip to conversation

Bug in cardbus initialization, or am I missing something?

PATCH David Hinds 2 participants 2 messages Mar 3, 2001

lore
Share & tools
lore
#0 lore raw

In drivers/pcmcia/cardbus.c in cb_alloc(), PCI_INTERRUPT_LINE and dev->irq are not filled in until after calling pci_enable_device(). The result is a cryptic message like:

Quoted 1 line

PCI: No IRQ known for interrupt pin A of device 01:00.0. Please try using pci=biosirq.

Unless there is a less obvious reason for the ordering, I suggest the following one-liner.

-- Dave Hinds

cardbus.c renamed from cardbus.c.orig +1 -1
@@ -288,7 +288,6 @@
 			if (res->flags)
 				pci_assign_resource(dev, r);
 		}
-		pci_enable_device(dev); /* XXX check return */
 
 		/* Does this function have an interrupt at all? */
 		pci_readb(dev, PCI_INTERRUPT_PIN, &irq_pin);
@@ -297,6 +296,7 @@
 			pci_writeb(dev, PCI_INTERRUPT_LINE, irq);
 		}
 
+		pci_enable_device(dev); /* XXX check return */
 		pci_insert_device(dev, bus);
 	}
 
#1 lore raw
Quoted 9 lines · David Hinds

In drivers/pcmcia/cardbus.c in cb_alloc(), PCI_INTERRUPT_LINE and dev->irq are not filled in until after calling pci_enable_device(). The result is a cryptic message like:

Quoted 1 line

PCI: No IRQ known for interrupt pin A of device 01:00.0. Please try using pci=biosirq.

Unless there is a less obvious reason for the ordering, I suggest the following one-liner.

Agreed.

In fact, we shouldn't need to enable the device at all: the drivers are supposed to do the pci_enable_device() themselves. But let's do the minimal "move it down a few lines" thing for now.

Thanks,

Linus