R: R: How to avoid serial port buffer overruns?

From: Giampaolo Tomassoni
Date: Fri Aug 18 2006 - 10:55:32 EST


> -----Messaggio originale-----
> Da: Robert Hancock [mailto:hancockr@xxxxxxx]
> Inviato: venerdì 18 agosto 2006 16.31
> A: Giampaolo Tomassoni
> Cc: Linux Kernel ML
> Oggetto: Re: R: How to avoid serial port buffer overruns?
>
> IRQ_HANDLED vs. IRQ_NONE has no effect on what interrupt handlers are
> called, etc. It is only used to detect if an interrupt is firing without
> being handled by any driver, in this case the kernel can detect this and
> disable the interrupt.
>
> I'm not sure exactly why the driver is returning IRQ_HANDLED all the
> time, but edge-triggered interrupts are always tricky and there may be a
> case where it can't reliably detect this. Returning IRQ_HANDLED is the
> safe thing to do if you cannot be sure if your device raised an
> interrupt or not.

Oh, I see. This in handle_IRQ_event in /kernel/irq/handle.c confirms what you said:

do {
ret = action->handler(irq, action->dev_id, regs);
if (ret == IRQ_HANDLED)
status |= action->flags;
retval |= ret;
action = action->next;
} while (action);

There is no escape from the loop when the handler returns IRQ_HANDLED.

Thanks,

giampaolo

>
> --
> Robert Hancock Saskatoon, SK, Canada
> To email, remove "nospam" from hancockr@xxxxxxxxxxxxx
> Home Page: http://www.roberthancock.com/
>

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/