public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.4.21: Sharing interrupts with serial console
@ 2005-08-04  1:36 Chris Budd
  2005-08-04  7:54 ` Russell King
  2005-08-04 11:16 ` linux-os (Dick Johnson)
  0 siblings, 2 replies; 4+ messages in thread
From: Chris Budd @ 2005-08-04  1:36 UTC (permalink / raw)
  To: linux-kernel, linux-serial

I have read http://www.tldp.org/HOWTO/Remote-Serial-Console-HOWTO/preparation-setport.html
and http://www.linux-mips.org/archives/linux-mips/2004-04/msg00134.html
and other items, but I still have not found the answers to the
following questions:

1.  The rs_init function in ./linux-2.4.21/drivers/char/serial.c
explicitly states "The interrupt of the serial console port can't be
shared."  Does this include *ALL* interrupts?  The code checks for
sharing only with other serial devices, not *ALL* types of devices
like I2C, RTC, etc.

2.  While the presence of the comment about not sharing was nice, it
does not explain "why?"  Why can't we share the serial console
interrupt?  The serial console seems to work when I alter serial.c to
skip this check for the sharing of interrupts with the serial console.

3.  Does the hardware platform matter?  We are running Linux 2.4.21 on
an embedded XScale(ARM)-based board.

Thanks,
Chris.

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

* Re: 2.4.21: Sharing interrupts with serial console
  2005-08-04  1:36 2.4.21: Sharing interrupts with serial console Chris Budd
@ 2005-08-04  7:54 ` Russell King
  2005-08-04 14:29   ` Chris Budd
  2005-08-04 11:16 ` linux-os (Dick Johnson)
  1 sibling, 1 reply; 4+ messages in thread
From: Russell King @ 2005-08-04  7:54 UTC (permalink / raw)
  To: Chris Budd; +Cc: linux-kernel, linux-serial

On Wed, Aug 03, 2005 at 06:36:51PM -0700, Chris Budd wrote:
> 1.  The rs_init function in ./linux-2.4.21/drivers/char/serial.c
> explicitly states "The interrupt of the serial console port can't be
> shared."  Does this include *ALL* interrupts?  The code checks for
> sharing only with other serial devices, not *ALL* types of devices
> like I2C, RTC, etc.

I think you'll find that older versions of the serial driver did not
allow the IRQ to be shared by other devices.  It probably got changed
with the addition of PCI card support.

> 2.  While the presence of the comment about not sharing was nice, it
> does not explain "why?"

Connecting a level-active interrupt output to an edge-triggered
interrupt controller input is Bad News(tm) for missing interrupts.

The situation is as follows:
- serial port asserts interrupt output which triggers an interrupt
  to the CPU.  You enter the serial handler.

- Before you clear the serial interrupt, the other device sharing
  this interrupt asserts its interrupt output - so there was no
  edge transition.

- You complete service the serial port, and move on to service the
  other device.

- Before you clear it's interrupt, the serial port re-asserts its
  interrupt output, and again there was no edge transition as far
  as the interrupt controller can tell.

- You complete servicing the other device and leave return from
  interrupt mode.

>From this point on, neither device can cause an interrupt to be sent
to the CPU again.

The above is rather long to put in a comment.

> Why can't we share the serial console interrupt?
> The serial console seems to work when I alter serial.c to
> skip this check for the sharing of interrupts with the serial console.

If the interrupt is shared, it's possible for the interrupt handler to
service the serial port while it's being used to send a kernel message,
and thereby disrupt the kernel message output.

> 3.  Does the hardware platform matter?  We are running Linux 2.4.21 on
> an embedded XScale(ARM)-based board.

Depends how you've connected the serial port interrupt.  Edge triggered
inputs bad, level triggered good.

If your Intel hardware doesn't have level triggered input capabilities,
please apply customer pressure to Intel to ensure that they consider it
for their future ARM-based designs.

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

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

* Re: 2.4.21: Sharing interrupts with serial console
  2005-08-04  1:36 2.4.21: Sharing interrupts with serial console Chris Budd
  2005-08-04  7:54 ` Russell King
@ 2005-08-04 11:16 ` linux-os (Dick Johnson)
  1 sibling, 0 replies; 4+ messages in thread
From: linux-os (Dick Johnson) @ 2005-08-04 11:16 UTC (permalink / raw)
  To: Chris Budd; +Cc: Linux kernel, linux-serial


On Wed, 3 Aug 2005, Chris Budd wrote:

> I have read http://www.tldp.org/HOWTO/Remote-Serial-Console-HOWTO/preparation-setport.html
> and http://www.linux-mips.org/archives/linux-mips/2004-04/msg00134.html
> and other items, but I still have not found the answers to the
> following questions:
>
> 1.  The rs_init function in ./linux-2.4.21/drivers/char/serial.c
> explicitly states "The interrupt of the serial console port can't be
> shared."  Does this include *ALL* interrupts?  The code checks for
> sharing only with other serial devices, not *ALL* types of devices
> like I2C, RTC, etc.
>
> 2.  While the presence of the comment about not sharing was nice, it
> does not explain "why?"  Why can't we share the serial console
> interrupt?  The serial console seems to work when I alter serial.c to
> skip this check for the sharing of interrupts with the serial console.
>
> 3.  Does the hardware platform matter?  We are running Linux 2.4.21 on
> an embedded XScale(ARM)-based board.
>
> Thanks,
> Chris.
> -

Only LEVEL interrupts can be shared, and all the drivers that
share that one interrupt need to be designed for sharing.


Cheers,
Dick Johnson
Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
Warning : 98.36% of all statistics are fiction.
.
I apologize for the following. I tried to kill it with the above dot :

****************************************************************
The information transmitted in this message is confidential and may be privileged.  Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited.  If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to DeliveryErrors@analogic.com - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.

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

* Re: 2.4.21: Sharing interrupts with serial console
  2005-08-04  7:54 ` Russell King
@ 2005-08-04 14:29   ` Chris Budd
  0 siblings, 0 replies; 4+ messages in thread
From: Chris Budd @ 2005-08-04 14:29 UTC (permalink / raw)
  To: Chris Budd, linux-kernel, linux-serial

On 8/4/05, Russell King <rmk+lkml@arm.linux.org.uk> wrote:
> On Wed, Aug 03, 2005 at 06:36:51PM -0700, Chris Budd wrote:
> > 1.  The rs_init function in ./linux-2.4.21/drivers/char/serial.c
> > explicitly states "The interrupt of the serial console port can't be
> > shared."  Does this include *ALL* interrupts?  The code checks for
> > sharing only with other serial devices, not *ALL* types of devices
> > like I2C, RTC, etc.
<snip>
> > 2.  While the presence of the comment about not sharing was nice, it
> > does not explain "why?"
> 
> Connecting a level-active interrupt output to an edge-triggered
> interrupt controller input is Bad News(tm) for missing interrupts.
> 

Of course.  I thought it was something more serious in the bowels of
the kernel.  All the comment needed was just that one adjective "The
*edge-triggered* interrupt of the serial console port can't be
shared."  I know many programmers do not like to write comments, but
good comments make the code more robust and stable:  the code clearly
shows *what* you did, but comments are necessary to indicate *why*.

<snip>
> If your Intel hardware doesn't have level triggered input capabilities,
> please apply customer pressure to Intel to ensure that they consider it
> for their future ARM-based designs.

You will be happy to know that the Intel IOP80321 has level-sensitive
interrupts.

Thank you for the detailed explanation.
Chris.

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

end of thread, other threads:[~2005-08-04 14:29 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-04  1:36 2.4.21: Sharing interrupts with serial console Chris Budd
2005-08-04  7:54 ` Russell King
2005-08-04 14:29   ` Chris Budd
2005-08-04 11:16 ` linux-os (Dick Johnson)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox