login
Header Space

 
 

Re: MSI problem since 2.6.21 for devices not providing a mask in their MSI capability

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Loic Prylli <loic@...>
Cc: <linux-pci@...>, Linux Kernel Mailing List <linux-kernel@...>
Date: Thursday, October 4, 2007 - 1:03 pm

Loic Prylli <loic@myri.com> writes:

I still looking through my copy of the pci specs and so will reply to
that part in a bit.


Hmm. Something like this?

Only mask it if the irq is disabled, and only disable it if
the user requests it or if note_interrupt decides we are screaming?

void handle_edge_irq(unsigned int irq, struct irq_desc *desc)
{
	const unsigned int cpu = smp_processor_id();

	spin_lock(&desc->lock);

	desc->status &= ~(IRQ_REPLAY | IRQ_WAITING);

	/*
	 * If we're currently running this IRQ, or its disabled,
	 * we shouldn't process the IRQ. Mark it pending, handle
	 * the necessary masking and go out
	 */
	if (unlikely((desc->status & IRQ_DISABLED) || !desc->action)){
        	desc->status |= (IRQ_PENDING | IRQ_MASKED);
                mask_ack_irq(desc, irq);
                goto out_unlock;
	}    
	if (unlikely(desc->status & IRQ_INPROGRESS)) {
		desc->status |= IRQ_PENDING;
		desc->chip->ack(desc, irq);
                note_interrupt(irq, desc, IRQ_NONE /* IRQ_DUP? */);
		goto out_unlock;
	}

	kstat_cpu(cpu).irqs[irq]++;

	/* Start handling the irq */
	desc->chip->ack(irq);

	/* Mark the IRQ currently in progress.*/
	desc->status |= IRQ_INPROGRESS;

	do {
		struct irqaction *action = desc->action;
		irqreturn_t action_ret;

		if (unlikely(!action)) {
			desc->chip->mask(irq);
			goto out_unlock;
		}

		desc->status &= ~IRQ_PENDING;
		spin_unlock(&desc->lock);
		action_ret = handle_IRQ_event(irq, action);
		if (!noirqdebug)
			note_interrupt(irq, desc, action_ret);
		spin_lock(&desc->lock);

	} while ((desc->status & (IRQ_PENDING | IRQ_DISABLED)) == IRQ_PENDING);

	desc->status &= ~IRQ_INPROGRESS;
out_unlock:
	spin_unlock(&desc->lock);
}

Eric
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
Re: MSI problem since 2.6.21 for devices not providing a mas..., Eric W. Biederman, (Wed Oct 3, 11:58 pm)
Re: MSI problem since 2.6.21 for devices not providing a mas..., Eric W. Biederman, (Thu Oct 4, 1:03 pm)
Re: MSI problem since 2.6.21 for devices not providing a mas..., Benjamin Herrenschmidt, (Wed Oct 3, 6:03 pm)
speck-geostationary