mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: m.brock@vanmierlo.com
To: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] sc16is7xx: Do not handle irqs in endless loop
Date: Tue, 09 Aug 2016 10:52:17 +0200	[thread overview]
Message-ID: <a8fa01784fab7e63183022541e315c86@vanmierlo.com> (raw)
In-Reply-To: <1470663136-26269-1-git-send-email-dirk.eibach@gdsys.cc>

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

      parent reply	other threads:[~2016-08-09  9:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-08 13:32 dirk.eibach
2016-08-08 13:32 ` [PATCH 2/2] sc16is7xx: Disable regmap cache dirk.eibach
2016-08-08 13:43 ` [PATCH 1/2] sc16is7xx: Do not handle irqs in endless loop Greg KH
2016-08-08 14:02   ` Dirk Eibach
2016-08-09  8:52 ` m.brock [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a8fa01784fab7e63183022541e315c86@vanmierlo.com \
    --to=m.brock@vanmierlo.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®