From: s.hauer@pengutronix.de (Sascha Hauer)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 11/12] mxc_nand: do not depend on disabling the irq in the interrupt handler
Date: Wed, 11 Aug 2010 14:46:17 +0200 [thread overview]
Message-ID: <20100811124617.GR27749@pengutronix.de> (raw)
In-Reply-To: <1281442473-31428-3-git-send-email-s.hauer@pengutronix.de>
On Tue, Aug 10, 2010 at 02:14:32PM +0200, Sascha Hauer wrote:
> This patch reverts the driver to enabling/disabling the NFC interrupt
> mask rather than enabling/disabling the system interrupt. This cleans
> up the driver so that it doesn't rely on interrupts being disabled
> within the interrupt handler.
> This patch is based on earlier work by John Ogness.
>
> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
> ---
> drivers/mtd/nand/mxc_nand.c | 78 +++++++++++++++++++++++++++++++++++++------
> 1 files changed, 67 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/mtd/nand/mxc_nand.c b/drivers/mtd/nand/mxc_nand.c
> index 3767dcc..0cc4343 100644
> --- a/drivers/mtd/nand/mxc_nand.c
> +++ b/drivers/mtd/nand/mxc_nand.c
> @@ -30,6 +30,8 @@
> #include <linux/clk.h>
> #include <linux/err.h>
> #include <linux/io.h>
> +#include <linux/irq.h>
> +#include <linux/completion.h>
>
> #include <asm/mach/flash.h>
> #include <mach/mxc_nand.h>
> @@ -149,7 +151,7 @@ struct mxc_nand_host {
> int irq;
> int eccsize;
>
> - wait_queue_head_t irq_waitq;
> + struct completion op_completion;
>
> uint8_t *data_buf;
> unsigned int buf_start;
> @@ -162,6 +164,7 @@ struct mxc_nand_host {
> void (*send_read_id)(struct mxc_nand_host *);
> uint16_t (*get_dev_status)(struct mxc_nand_host *);
> int (*check_int)(struct mxc_nand_host *);
> + void (*irq_control)(struct mxc_nand_host *, int);
> };
>
> /* OOB placement block for use with hardware ecc generation */
> @@ -214,9 +217,14 @@ static irqreturn_t mxc_nfc_irq(int irq, void *dev_id)
> {
> struct mxc_nand_host *host = dev_id;
>
> - disable_irq_nosync(irq);
> + if (!host->check_int(host)) {
> + printk("none?\n");
Nah, this printk goes away of course.
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 12:46 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-10 12:14 mxc_nand: missing patches Sascha Hauer
2010-08-10 12:14 ` [PATCH 10/12] mxc_nand: remove unused variables Sascha Hauer
2010-08-10 12:14 ` [PATCH 11/12] mxc_nand: do not depend on disabling the irq in the interrupt handler Sascha Hauer
2010-08-11 12:46 ` Sascha Hauer [this message]
2010-08-10 12:14 ` [PATCH 12/12] mxc_nand: configure pages per block for v2 controller Sascha Hauer
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=20100811124617.GR27749@pengutronix.de \
--to=s.hauer@pengutronix.de \
--cc=linux-arm-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).