Skip to contentSkip to conversation

[email protected], [email protected]: [PATCH] Updated patches for PCI IRQ resource deallocation support [3/3]

DISCUSSION Zwane Mwaikambo 3 participants 3 messages Sep 25, 2004 – Sep 27, 2004 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hello Kenji,

Quoted 4 lines · Kenji Kaneshige
(quoted diff) +4 -0
+		/*
+		 * If interrupt handlers still exists on the irq
+		 * associated with the gsi, don't unregister the
+		 * interrupt.

Review

Quoted 10 lines
(quoted diff) +10 -0
+		 */
+		if (unlikely(idesc->action)) {
+			iosapic_intr_info[vector].refcnt++;
+			spin_unlock_irqrestore(&idesc->lock, flags);
+			printk(KERN_WARNING "Cannot unregister GSI. IRQ %u is still in use.\n", irq);
+			return;
+		}
+
+		/* Clear the interrupt controller descriptor. */
+		idesc->handler = &no_irq_type;

Hmm, what happens here if that vector was queued just before the local irq disable in spin_lock_irqsave(idesc->lock...) ? Then when we unlock we'll call do_IRQ to handle the irq associated with that vector. I haven't seen the usage but it appears that iosapic_unregister_intr requires some serialisation.

Thanks,
Zwane

#2 lore raw
Quoted 5 lines · Zwane Mwaikambo

Hmm, what happens here if that vector was queued just before the local irq disable in spin_lock_irqsave(idesc->lock...) ? Then when we unlock we'll call do_IRQ to handle the irq associated with that vector. I haven't seen the usage but it appears that iosapic_unregister_intr requires some serialisation.

Ignore this, i misread some of the code.

Thanks Kenji,
Zwane

#3 lore raw
Quoted 9 lines · Zwane Mwaikambo
Quoted 1 line · Zwane Mwaikambo

Hmm, what happens here if that vector was queued just before the local irq disable in spin_lock_irqsave(idesc->lock...) ? Then when we unlock we'll call do_IRQ to handle the irq associated with that vector. I haven't seen the usage but it appears that iosapic_unregister_intr requires some serialisation.

Ignore this, i misread some of the code.

Thanks Kenji,
Zwane

OK.
BTW, I was able to find a bug thanks to your comment :-) The following 'spin_lock(&iosapic_lock)' was missing. I'll update the patch.

	if (unlikely(idesc->action)) {
		iosapic_intr_info[vector].refcnt++;
MISSING =>	spin_unlock(&iosapic_lock);
		spin_unlock_irqrestore(&idesc->lock, flags);
		printk(KERN_WARNING "Cannot unregister GSI. IRQ %u is still in use.\n", irq);
		return;
	}

Thanks,
Kenji Kaneshige