Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1458543

Re: [PATCH 1/2] sc16is7xx: Do not handle irqs in endless loop

From m.brock@vanmierlo.com
Newsgroups linux.kernel
Subject Re: [PATCH 1/2] sc16is7xx: Do not handle irqs in endless loop
Date 2016-08-09 11:30 +0200
Message-ID <s4bwd-5Ex-23@gated-at.bofh.it> (permalink)
References <s3T6i-22X-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 2016-08-08 15:32, dirk.eibach@gdsys.cc wrote:
> From: Dirk Eibach <dirk.eibach@gdsys.cc>
> 
> sc16is7xx_port_irq() is laid out as an endless loop. It will exit only
> when there is no more interrupt left to service. This not common
> practice.
> In our case it lead to some strange hangup situation when there was an
> unexpected XOFF-interrupt that could not be handled.
> So let's service interrupts only once and report XOFF-interrupts that
> should never happen since they are never enabled.

The reason for such an endless loop in an interrupt handler usually 
means
that multiple sources can generate an interrupt and the interrupt 
controller
is configured for edge. During handling the interrupt of one source 
(e.g.
data received) but before it is cleared, another interrupt can trigger 
(e.g.
transmit done). This will not generate a new edge as the interrupt line 
is
still active! Thus re-reading the interrupt status is required. And with
interrupt sharing this problem gets even worse. The fact that the 
sc16is7xx
uses an indirect interface like i2c or spi doesn't help either.

When configured for level interrupts the interrupt will automatically
re-trigger. But the risk of interrupt storm when the hardware is broken
(interrupt line stuck active) seems to keep developers away from setting
level interrupt. IMHO an interrupt storm should be detectable by the
interrupt handler so nobody needs to fear using level sensitive 
interrupts.

Maarten

Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

[PATCH 1/2] sc16is7xx: Do not handle irqs in endless loop dirk.eibach@gdsys.cc - 2016-08-08 15:50 +0200
  Re: [PATCH 1/2] sc16is7xx: Do not handle irqs in endless loop m.brock@vanmierlo.com - 2016-08-09 11:30 +0200

csiph-web