mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Remy Bohmer" <linux@bohmer.net>
To: "Russell King - ARM Linux" <linux@arm.linux.org.uk>
Cc: "Steven Rostedt" <rostedt@goodmis.org>,
	"Daniel Walker" <dwalker@mvista.com>,
	RT <linux-rt-users@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	"ARM Linux Mailing List"
	<linux-arm-kernel@lists.arm.linux.org.uk>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Ingo Molnar" <mingo@elte.hu>
Subject: Re: [PATCH PREEMPT_RT]: On AT91 ARM: GPIO Interrupt handling can/will stall forever
Date: Thu, 29 Nov 2007 12:27:30 +0100	[thread overview]
Message-ID: <3efb10970711290327s3c60da1ey3b6fae738090ca5@mail.gmail.com> (raw)
In-Reply-To: <20071129102506.GB22793@flint.arm.linux.org.uk>

Hello Russell,

> If 'no' then it's the right handler and the mask/unmask methods associated
> with the interrupt will be no-ops.

I completely understand what you keep on saying, but that would imply
that the following piece of code in chip.c is completely bogus anyway!
(snip from mainline 2.6.23)

handle_simple_irq(unsigned int irq, struct irq_desc *desc)
...
	if (unlikely(!action || (desc->status & IRQ_DISABLED))) {
		if (desc->chip->mask)
			desc->chip->mask(irq);
...
}

Why trying to mask the interrupt if that is illegal use of the interrupt type?
This piece of code assumes that there CAN be a handler for masking
interrupts for the simple_irq type. This is in contradiction what you
are trying to explain.

If what you say is (completely) true the code is better to be:
....
		if (desc->chip->mask)
                             BUG();
....

IMO, interrupts can still be simple_irq types if the interrupt source
does **not have to** be disabled to be able to handle them. These
(GPIO) interrupts signal an event, that is already gone when the
interrupt handler starts, they are **never** really pending, waiting
for some device driver to handle the event. The device does not really
care if the interrupt is really handled, it just generates a new
interrupt on the next event.
And yes, it is possible that these interrupts can be seperately
masked/unmasked, but it is not necessary, and therefor others chose
apparantly for the simple_irq() types.

So, I do not think that the argument of **can** masked/unmasked is
valid, but more the **need** to be masked/unmasked is valid.

I think we should not argue if this is correct use, or misuse.
Fact is now that there is a bug in RT, that this type of 'misuse' does
not work on RT and breaks the interrupt handling. There are even more
patches floating around to fix this.

According to what Daniel also mentions, there are already several
architectures that use this type of interrupt with a masking/unmasking
implementation, apparantly all without the **need** to masking them.

So, the code must prevent this type of 'misuse' (and thus not
supporting it as it is doing now) or fully support it on RT, just like
on mainline.

So, in short: IMO, only RT is broken, not mainline -> thus fix RT,
otherwise we will have regression compared to mainline.

Kind Regards,

Remy


2007/11/29, Russell King - ARM Linux <linux@arm.linux.org.uk>:
> On Thu, Nov 29, 2007 at 11:14:30AM +0100, Remy Bohmer wrote:
> > I do not think Russell is right here with assuming that the wrong
> > interrupt handler type is used. Looking at the behaviour of the
> > mainline kernel (non-RT), the implementation is quite different: On
> > mainline the handle_simple_irq() in chip.c is not re-entrant, the
> > masking is **only** done in case of errors, and therefor never
> > unmasked again, of course.
>
> The issue comes down to a very simple question:
>
>   Are you using handle_simple_irq() with an interrupt which can be masked?
>
> If the answer to that question is 'yes' then you're using the wrong handler.
> If 'no' then it's the right handler and the mask/unmask methods associated
> with the interrupt will be no-ops.
>
> Therefore, if you have mask/unmask methods for a simple IRQ which actually
> do something, clearly the first answer is the one which applies.  You're
> using the wrong handler.  Use the level or edge handlers instead.
>

  reply	other threads:[~2007-11-29 11:27 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-26 13:31 Remy Bohmer
2007-11-26 13:45 ` Remy Bohmer
2007-11-27 15:11   ` Steven Rostedt
2007-11-27 15:25     ` Daniel Walker
2007-11-27 15:53       ` Daniel Walker
2007-11-28 14:38         ` Remy Bohmer
2007-11-28 15:36           ` Daniel Walker
2007-11-28 17:25           ` Russell King - ARM Linux
2007-11-28 19:04             ` Steven Rostedt
2007-11-28 20:05               ` Russell King - ARM Linux
2007-11-28 20:16                 ` Steven Rostedt
2007-11-28 20:44                   ` Daniel Walker
2007-11-28 21:13                     ` Steven Rostedt
2007-11-28 23:03                       ` Russell King - ARM Linux
2007-11-28 23:19                         ` Daniel Walker
2007-11-29  9:04                           ` Russell King - ARM Linux
2007-11-29 10:14                   ` Remy Bohmer
2007-11-29 10:25                     ` Russell King - ARM Linux
2007-11-29 11:27                       ` Remy Bohmer [this message]
2007-11-29 13:36                         ` Russell King - ARM Linux
2007-11-29 13:57                           ` Steven Rostedt
2007-11-29 14:18                           ` Remy Bohmer
2007-11-29 14:29                             ` Russell King - ARM Linux
2007-11-29 15:33                               ` Remy Bohmer
2007-11-29 16:20                                 ` Remy Bohmer
2007-11-29 16:30                                 ` Steven Rostedt
2007-11-30 21:44                           ` Thomas Gleixner
2007-12-12 19:40         ` [PATCH RT] Revert Softdisable for simple irqs Steven Rostedt
2007-12-12 19:46           ` Russell King
2007-12-12 20:05           ` Remy Bohmer
2007-12-12 20:27             ` Steven Rostedt
2007-12-12 21:38               ` Remy Bohmer
     [not found] ` <87bq9fqpoi.fsf@vence.hilman.org>
2007-11-28 14:43   ` [PATCH PREEMPT_RT]: On AT91 ARM: GPIO Interrupt handling can/will stall forever Remy Bohmer

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=3efb10970711290327s3c60da1ey3b6fae738090ca5@mail.gmail.com \
    --to=linux@bohmer.net \
    --cc=dwalker@mvista.com \
    --cc=linux-arm-kernel@lists.arm.linux.org.uk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mingo@elte.hu \
    --cc=rostedt@goodmis.org \
    --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 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®