From: Nicolas Ferre <nicolas.ferre@atmel.com>
To: "Voss, Nikolaus" <N.Voss@weinmann.de>
Cc: "'Linux Kernel'" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drivers/spi/atmel_spi.c: prevent premature irqs
Date: Mon, 11 Apr 2011 10:50:08 +0200 [thread overview]
Message-ID: <4DA2C0C0.6050903@atmel.com> (raw)
In-Reply-To: <EF2E73589CA71846A15D0B2CDF79505D086F931361@wm021.weinmann.com>
Le 11/04/2011 08:53, Voss, Nikolaus :
> When restarting a kernel using kexec, filled rx buffers on SPI master
> interface reliably crash the kernel. This patch disables rx interrupts
> on startup to avoid this. Interrupts will be regulary enabled at start
> of a new SPI master transfer.
>
> Signed-off-by: Nikolaus Voss <n.voss@weinmann.de>
> ---
> drivers/spi/atmel_spi.c | 3 +++
> 1 files changed, 3 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/spi/atmel_spi.c b/drivers/spi/atmel_spi.c
> index 1a478bf..d17f14c 100644
> --- a/drivers/spi/atmel_spi.c
> +++ b/drivers/spi/atmel_spi.c
> @@ -811,6 +811,9 @@ static int __init atmel_spi_probe(struct platform_device *pdev)
> as->irq = irq;
> as->clk = clk;
>
> + /* disable rx interrupts to avoid premature irq triggering */
> + spi_writel(as, IDR, SPI_BIT(RXBUFF) | SPI_BIT(ENDRX) | SPI_BIT(OVRES));
> +
What about something like this?
/* disable all interrupts to avoid premature irq triggering */
spi_writel(as, IDR, 0xffffffff);
> ret = request_irq(irq, atmel_spi_interrupt, 0,
> dev_name(&pdev->dev), master);
> if (ret)
Best regards,
--
Nicolas Ferre
next prev parent reply other threads:[~2011-04-11 8:50 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-11 6:53 [PATCH] drivers/spi/atmel_spi.c: prevent premature irqs Voss, Nikolaus
2011-04-11 8:50 ` Nicolas Ferre [this message]
2011-04-11 9:38 ` Voss, Nikolaus
2011-04-18 8:29 ` Nicolas Ferre
2011-04-18 8:29 ` Nicolas Ferre
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=4DA2C0C0.6050903@atmel.com \
--to=nicolas.ferre@atmel.com \
--cc=N.Voss@weinmann.de \
--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