linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH] 8250 driver interrupt sharing
  2004-10-28 11:01 [PATCH] 8250 driver interrupt sharing Thomas Koeller
@ 2004-10-28 11:00 ` Russell King
  2004-10-28 11:17   ` Thomas Koeller
  2004-11-01 12:10 ` Russell King
  1 sibling, 1 reply; 5+ messages in thread
From: Russell King @ 2004-10-28 11:00 UTC (permalink / raw)
  To: Thomas Koeller; +Cc: linux-serial

On Thu, Oct 28, 2004 at 01:01:58PM +0200, Thomas Koeller wrote:
> here is a little patch that causes the driver to no longer pretend having
> handled an interrupt if none of the ports actually interrupted. I am currently
> doing a port to a platform where I want (actually, have) to share a single
> interrupt between serial ports and other devices. The patch is against kernel
> version 2.6.9.

You can only share serial port interrupts with other devices if the
interrupt controller input is level sensitive rather than edge
sensitive.  If it is edge sensitive, then you'll run into problems.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] 8250 driver interrupt sharing
@ 2004-10-28 11:01 Thomas Koeller
  2004-10-28 11:00 ` Russell King
  2004-11-01 12:10 ` Russell King
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Koeller @ 2004-10-28 11:01 UTC (permalink / raw)
  To: rmk+serial; +Cc: linux-serial

Hi,

here is a little patch that causes the driver to no longer pretend having
handled an interrupt if none of the ports actually interrupted. I am currently
doing a port to a platform where I want (actually, have) to share a single
interrupt between serial ports and other devices. The patch is against kernel
version 2.6.9.

tk

Signed-off-by: Thomas Koeller <thomas.koeller@baslerweb.com>

--- linux-2.6.9-old/drivers/serial/8250.c       2004-10-28 12:45:30.103541664 +0200
+++ linux-2.6.9/drivers/serial/8250.c   2004-10-28 12:48:19.009864000 +0200
@@ -1039,6 +1039,7 @@ static irqreturn_t serial8250_interrupt(
        struct irq_info *i = dev_id;
        struct list_head *l, *end = NULL;
        int pass_counter = 0;
+       irqreturn_t ret = IRQ_NONE;

        DEBUG_INTR("serial8250_interrupt(%d)...", irq);

@@ -1056,6 +1057,7 @@ static irqreturn_t serial8250_interrupt(
                        spin_lock(&up->port.lock);
                        serial8250_handle_port(up, regs);
                        spin_unlock(&up->port.lock);
+                       ret = IRQ_HANDLED;

                        end = NULL;
                } else if (end == NULL)
@@ -1074,8 +1076,7 @@ static irqreturn_t serial8250_interrupt(
        spin_unlock(&i->lock);

        DEBUG_INTR("end.\n");
-       /* FIXME! Was it really ours? */
-       return IRQ_HANDLED;
+       return ret;
 }

 /*

-- 
--------------------------------------------------

Thomas Koeller, Software Development
Basler Vision Technologies

thomas dot koeller at baslerweb dot com
http://www.baslerweb.com

==============================


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] 8250 driver interrupt sharing
  2004-10-28 11:00 ` Russell King
@ 2004-10-28 11:17   ` Thomas Koeller
  2004-10-28 11:18     ` Russell King
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Koeller @ 2004-10-28 11:17 UTC (permalink / raw)
  To: Russell King; +Cc: linux-serial

On Thursday 28 October 2004 13:00, Russell King wrote:
> On Thu, Oct 28, 2004 at 01:01:58PM +0200, Thomas Koeller wrote:
> > here is a little patch that causes the driver to no longer pretend having
> > handled an interrupt if none of the ports actually interrupted. I am
> > currently doing a port to a platform where I want (actually, have) to
> > share a single interrupt between serial ports and other devices. The
> > patch is against kernel version 2.6.9.
>
> You can only share serial port interrupts with other devices if the
> interrupt controller input is level sensitive rather than edge
> sensitive.  If it is edge sensitive, then you'll run into problems.

On my target platform, interrupts are indeed level sensitive, so this
should not be a problem (for me).

Does this problem somehow invalidate my patch? Even if interrupts were
edge sensitive, returning IRQ_NONE should ok, or not?

tk

-- 
--------------------------------------------------

Thomas Koeller, Software Development
Basler Vision Technologies

thomas dot koeller at baslerweb dot com
http://www.baslerweb.com

==============================


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] 8250 driver interrupt sharing
  2004-10-28 11:17   ` Thomas Koeller
@ 2004-10-28 11:18     ` Russell King
  0 siblings, 0 replies; 5+ messages in thread
From: Russell King @ 2004-10-28 11:18 UTC (permalink / raw)
  To: Thomas Koeller; +Cc: linux-serial

On Thu, Oct 28, 2004 at 01:17:41PM +0200, Thomas Koeller wrote:
> On Thursday 28 October 2004 13:00, Russell King wrote:
> > On Thu, Oct 28, 2004 at 01:01:58PM +0200, Thomas Koeller wrote:
> > > here is a little patch that causes the driver to no longer pretend having
> > > handled an interrupt if none of the ports actually interrupted. I am
> > > currently doing a port to a platform where I want (actually, have) to
> > > share a single interrupt between serial ports and other devices. The
> > > patch is against kernel version 2.6.9.
> >
> > You can only share serial port interrupts with other devices if the
> > interrupt controller input is level sensitive rather than edge
> > sensitive.  If it is edge sensitive, then you'll run into problems.
> 
> On my target platform, interrupts are indeed level sensitive, so this
> should not be a problem (for me).

Ok - that's fine.

> Does this problem somehow invalidate my patch?

Not really, but if you were using edge triggering, that would invalidate
your idea that you could share serial port interrupts reliably with other
devices.

> Even if interrupts were edge sensitive, returning IRQ_NONE should ok,
> or not?

It should be fine.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] 8250 driver interrupt sharing
  2004-10-28 11:01 [PATCH] 8250 driver interrupt sharing Thomas Koeller
  2004-10-28 11:00 ` Russell King
@ 2004-11-01 12:10 ` Russell King
  1 sibling, 0 replies; 5+ messages in thread
From: Russell King @ 2004-11-01 12:10 UTC (permalink / raw)
  To: Thomas Koeller; +Cc: linux-serial

On Thu, Oct 28, 2004 at 01:01:58PM +0200, Thomas Koeller wrote:
> here is a little patch that causes the driver to no longer pretend having
> handled an interrupt if none of the ports actually interrupted. I am currently
> doing a port to a platform where I want (actually, have) to share a single
> interrupt between serial ports and other devices. The patch is against kernel
> version 2.6.9.

Ok, a variant of this has now been applied - using IRQ_RETVAL rather
than irqreturn_t + IRQ_NONE + IRQ_HANDLED.

Thanks.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 PCMCIA      - http://pcmcia.arm.linux.org.uk/
                 2.6 Serial core

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-11-01 12:10 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-10-28 11:01 [PATCH] 8250 driver interrupt sharing Thomas Koeller
2004-10-28 11:00 ` Russell King
2004-10-28 11:17   ` Thomas Koeller
2004-10-28 11:18     ` Russell King
2004-11-01 12:10 ` Russell King

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).