From: Sascha Hauer <s.hauer@pengutronix.de>
To: John Ogness <john.ogness@linutronix.de>
Cc: Baruch Siach <baruch@tkos.co.il>,
linux-mtd@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
Ivo Clarysse <ivo.clarysse@gmail.com>
Subject: Re: [PATCH 1/3] mxc_nand: set spare size and pages per block
Date: Wed, 11 Aug 2010 15:27:28 +0200 [thread overview]
Message-ID: <20100811132728.GV27749@pengutronix.de> (raw)
In-Reply-To: <80r5i5z3v1.fsf@merkur.tec.linutronix.de>
On Wed, Aug 11, 2010 at 03:16:34PM +0200, John Ogness wrote:
> On 2010-08-11, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> >> Your version allows a small window between request_irq() and
> >> irq_control() where on the i.MX21 there is a possibility of the
> >> interrupts being disabled twice. Namely, if an interrupt occurs
> >> before irq_control() has had a chance to disable it. IMHO it would be
> >> better to call:
> >>
> >> set_irq_flags(host->irq, IRQF_VALID | IRQF_NOAUTOEN);
> >>
> >> for the i.MX21 before requesting the irq. This closes the window.
> >
> > IIRC it is not allowed to call set_irq_flags before request_irq. We
> > are changing a resource we do not own yet.
>
> Normally, yes. But the only way the IRQF_NOAUTOEN flag can ever be
> useful is if set_irq_flags() is called before request_irq().
>
> > I think the worst thing that could happen without this change is that
> > we get an interrupt after request_irq.
>
> Yes. And this causes a problem on the i.MX21 because the interrupt
> handler will disable the interrupts. The irq_control() after
> request_irq() will _also_ disable the interrupts. This means the
> interrupts are disabled twice, which causes some issues on an RT kernel.
>
> > Alternatively we could set the interrupt mask bit before requesting
> > the irq.
>
> Yes. This would be best. But for the i.MX21 it is important that the
> interrupts are unmasked after irq_control() has disabled the interrupts.
Ok, I'll update the patches to use this approach.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
WARNING: multiple messages have this Message-ID (diff)
From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 1/3] mxc_nand: set spare size and pages per block
Date: Wed, 11 Aug 2010 15:27:28 +0200 [thread overview]
Message-ID: <20100811132728.GV27749@pengutronix.de> (raw)
In-Reply-To: <80r5i5z3v1.fsf@merkur.tec.linutronix.de>
On Wed, Aug 11, 2010 at 03:16:34PM +0200, John Ogness wrote:
> On 2010-08-11, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> >> Your version allows a small window between request_irq() and
> >> irq_control() where on the i.MX21 there is a possibility of the
> >> interrupts being disabled twice. Namely, if an interrupt occurs
> >> before irq_control() has had a chance to disable it. IMHO it would be
> >> better to call:
> >>
> >> set_irq_flags(host->irq, IRQF_VALID | IRQF_NOAUTOEN);
> >>
> >> for the i.MX21 before requesting the irq. This closes the window.
> >
> > IIRC it is not allowed to call set_irq_flags before request_irq. We
> > are changing a resource we do not own yet.
>
> Normally, yes. But the only way the IRQF_NOAUTOEN flag can ever be
> useful is if set_irq_flags() is called before request_irq().
>
> > I think the worst thing that could happen without this change is that
> > we get an interrupt after request_irq.
>
> Yes. And this causes a problem on the i.MX21 because the interrupt
> handler will disable the interrupts. The irq_control() after
> request_irq() will _also_ disable the interrupts. This means the
> interrupts are disabled twice, which causes some issues on an RT kernel.
>
> > Alternatively we could set the interrupt mask bit before requesting
> > the irq.
>
> Yes. This would be best. But for the i.MX21 it is important that the
> interrupts are unmasked after irq_control() has disabled the interrupts.
Ok, I'll update the patches to use this approach.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
next prev parent reply other threads:[~2010-08-11 13:27 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-10 11:34 [PATCH 1/3] mxc_nand: set spare size and pages per block John Ogness
2010-08-10 11:34 ` John Ogness
2010-08-10 11:35 ` [PATCH 2/3] mxc_nand: remove unused variables John Ogness
2010-08-10 11:35 ` John Ogness
2010-08-10 11:36 ` [PATCH 3/3] mxc_nand: mask instead of disabling (i.MX21 as exception) John Ogness
2010-08-10 11:36 ` John Ogness
2010-08-10 12:19 ` [PATCH 1/3] mxc_nand: set spare size and pages per block Sascha Hauer
2010-08-10 12:19 ` Sascha Hauer
2010-08-10 14:31 ` John Ogness
2010-08-10 14:31 ` John Ogness
2010-08-10 14:43 ` John Ogness
2010-08-10 14:43 ` John Ogness
2010-08-11 12:56 ` Sascha Hauer
2010-08-11 12:56 ` Sascha Hauer
2010-08-11 13:16 ` John Ogness
2010-08-11 13:16 ` John Ogness
2010-08-11 13:27 ` Sascha Hauer [this message]
2010-08-11 13:27 ` Sascha Hauer
2010-08-16 11:28 ` Sascha Hauer
2010-08-16 11:28 ` Sascha Hauer
2010-08-16 12:05 ` John Ogness
2010-08-16 12:05 ` John Ogness
2010-08-17 8:54 ` Sascha Hauer
2010-08-17 8:54 ` Sascha Hauer
2010-08-17 17:02 ` John Ogness
2010-08-17 17:02 ` John Ogness
2010-08-29 12:08 ` Artem Bityutskiy
2010-08-29 12:08 ` Artem Bityutskiy
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=20100811132728.GV27749@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=baruch@tkos.co.il \
--cc=ivo.clarysse@gmail.com \
--cc=john.ogness@linutronix.de \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mtd@lists.infradead.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 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.