All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mason <slash.tmp@free.fr>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: Marc Zyngier <marc.zyngier@arm.com>,
	Jason Cooper <jason@lakedaemon.net>,
	LKML <linux-kernel@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	Sebastian Frias <sf84@laposte.net>
Subject: Re: Disabling an interrupt in the handler locks the system up
Date: Fri, 21 Oct 2016 22:27:23 +0200	[thread overview]
Message-ID: <580A7A2B.5000702@free.fr> (raw)
In-Reply-To: <alpine.DEB.2.20.1610212147420.4855@nanos>

On 21/10/2016 21:49, Thomas Gleixner wrote:
> On Fri, 21 Oct 2016, Mason wrote:
>> On 21/10/2016 21:14, Marc Zyngier wrote:
>>> If connecting a device that signals its interrupt as level low to an
>>> input line configured as level high doesn't strike you as a major
>>> issue, nothing will. At that point, you can put anything you want in
>>> your DT.
>>
>> If I understand correctly, you are saying that I should have
>> specified IRQ_TYPE_LEVEL_LOW, instead of IRQ_TYPE_LEVEL_HIGH?
>>
>> If the HW outputs 1 when idle, and 0 when busy, that
>> is level low? (Sorry if this is obvious, I'm absolutely
>> clueless in this subject matter.)
> 
> We describe the level which is raising the interrupt. So in your case the
> line goes to 0 when the interrupt is active, so the level is LOW.

I see. I'll try that on Monday.

In my mental picture of interrupts (which is obviously so
incomplete as to be wrong) interrupts are a way for hardware
to tell the CPU that they urgently need the CPU's attention.

Obviously, the hardware being idle (line high) is not an urgent
matter which interests the CPU. Likewise, I'm not sure the CPU
cares that the hardware is busy (line low). It seems to me the
interesting event from the CPU's perspective is when the
hardware completes a "task" (transition from low to high).

So I had originally configured the interrupt as IRQ_TYPE_EDGE_RISING.
(There is an edge detection block in the irqchip, but the HW designer
warned me that at low frequencies, it is possible to "miss" some edges,
and we should prefer level triggers if possible.)

Regards.

WARNING: multiple messages have this Message-ID (diff)
From: slash.tmp@free.fr (Mason)
To: linux-arm-kernel@lists.infradead.org
Subject: Disabling an interrupt in the handler locks the system up
Date: Fri, 21 Oct 2016 22:27:23 +0200	[thread overview]
Message-ID: <580A7A2B.5000702@free.fr> (raw)
In-Reply-To: <alpine.DEB.2.20.1610212147420.4855@nanos>

On 21/10/2016 21:49, Thomas Gleixner wrote:
> On Fri, 21 Oct 2016, Mason wrote:
>> On 21/10/2016 21:14, Marc Zyngier wrote:
>>> If connecting a device that signals its interrupt as level low to an
>>> input line configured as level high doesn't strike you as a major
>>> issue, nothing will. At that point, you can put anything you want in
>>> your DT.
>>
>> If I understand correctly, you are saying that I should have
>> specified IRQ_TYPE_LEVEL_LOW, instead of IRQ_TYPE_LEVEL_HIGH?
>>
>> If the HW outputs 1 when idle, and 0 when busy, that
>> is level low? (Sorry if this is obvious, I'm absolutely
>> clueless in this subject matter.)
> 
> We describe the level which is raising the interrupt. So in your case the
> line goes to 0 when the interrupt is active, so the level is LOW.

I see. I'll try that on Monday.

In my mental picture of interrupts (which is obviously so
incomplete as to be wrong) interrupts are a way for hardware
to tell the CPU that they urgently need the CPU's attention.

Obviously, the hardware being idle (line high) is not an urgent
matter which interests the CPU. Likewise, I'm not sure the CPU
cares that the hardware is busy (line low). It seems to me the
interesting event from the CPU's perspective is when the
hardware completes a "task" (transition from low to high).

So I had originally configured the interrupt as IRQ_TYPE_EDGE_RISING.
(There is an edge detection block in the irqchip, but the HW designer
warned me that at low frequencies, it is possible to "miss" some edges,
and we should prefer level triggers if possible.)

Regards.

  reply	other threads:[~2016-10-21 20:27 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-21 16:37 Disabling an interrupt in the handler locks the system up Mason
2016-10-21 16:37 ` Mason
2016-10-21 17:46 ` Marc Zyngier
2016-10-21 17:46   ` Marc Zyngier
2016-10-21 18:39   ` Mason
2016-10-21 18:39     ` Mason
2016-10-21 19:14     ` Marc Zyngier
2016-10-21 19:14       ` Marc Zyngier
2016-10-21 19:47       ` Mason
2016-10-21 19:47         ` Mason
2016-10-21 19:49         ` Thomas Gleixner
2016-10-21 19:49           ` Thomas Gleixner
2016-10-21 20:27           ` Mason [this message]
2016-10-21 20:27             ` Mason
2016-10-22 11:37             ` Marc Zyngier
2016-10-22 11:37               ` Marc Zyngier
2016-10-22 23:10               ` Mason
2016-10-22 23:10                 ` Mason
2016-10-24  8:17                 ` Marc Zyngier
2016-10-24  8:17                   ` Marc Zyngier
2016-10-24 16:12                 ` Mason
2016-10-24 16:12                   ` Mason
2016-10-24 16:55                   ` Thomas Gleixner
2016-10-24 16:55                     ` Thomas Gleixner
2016-10-25  8:29                     ` Sebastian Frias
2016-10-25  8:29                       ` Sebastian Frias
2016-10-25  8:36                       ` Mason
2016-10-25  8:36                         ` Mason
2016-10-25 10:45                         ` Marc Zyngier
2016-10-25 10:45                           ` Marc Zyngier
2016-10-25 13:56                           ` Mason
2016-10-25 13:56                             ` Mason
2016-10-25 13:56                             ` Thomas Gleixner
2016-10-25 13:56                               ` Thomas Gleixner
2016-10-25  9:20                       ` Thomas Gleixner
2016-10-25  9:20                         ` Thomas Gleixner

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=580A7A2B.5000702@free.fr \
    --to=slash.tmp@free.fr \
    --cc=jason@lakedaemon.net \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=sf84@laposte.net \
    --cc=tglx@linutronix.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.