From: Alexander Stein <alexanders83-S0/GAf8tV78@public.gmane.org>
To: Nicolas Ferre
<nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.org>,
Mark Brown <broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: Alexander Stein <alexanders83-S0/GAf8tV78@public.gmane.org>,
linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: [PATCH] spi: atmel: Fix scheduling while atomic bug
Date: Sun, 13 Apr 2014 12:45:10 +0200 [thread overview]
Message-ID: <1397385910-28368-1-git-send-email-alexanders83@web.de> (raw)
In-Reply-To: <20140411214815.GI28800-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
atmel_spi_lock does a spin_lock_irqsave, so we need to renable the
interrupts when we want to schedule.
Signed-off-by: Alexander Stein <alexanders83-S0/GAf8tV78@public.gmane.org>
---
I'm not sure what the lock is actually good for, so I kept it and release
it when we are about to schedule, thus reenabling interrupts.
drivers/spi/spi-atmel.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/spi/spi-atmel.c b/drivers/spi/spi-atmel.c
index 5d7b07f..ae22f3d 100644
--- a/drivers/spi/spi-atmel.c
+++ b/drivers/spi/spi-atmel.c
@@ -1130,8 +1130,11 @@ static int atmel_spi_one_transfer(struct spi_master *master,
atmel_spi_next_xfer_pio(master, xfer);
}
+ /* interrupts are disabled, so free the lock for schedule */
+ atmel_spi_unlock(as);
ret = wait_for_completion_timeout(&as->xfer_completion,
SPI_DMA_TIMEOUT);
+ atmel_spi_lock(as);
if (WARN_ON(ret == 0)) {
dev_err(&spi->dev,
"spi trasfer timeout, err %d\n", ret);
--
1.9.2
--
To unsubscribe from this list: send the line "unsubscribe linux-spi" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2014-04-13 10:45 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-04-11 13:25 spi-atmel: scheduling while atomic Alexander Stein
2014-04-11 16:22 ` Mark Brown
[not found] ` <20140411162223.GG28800-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-04-11 21:11 ` Alexander Stein
2014-04-11 21:48 ` Mark Brown
[not found] ` <20140411214815.GI28800-GFdadSzt00ze9xe1eoZjHA@public.gmane.org>
2014-04-13 10:45 ` Alexander Stein [this message]
[not found] ` <1397385910-28368-1-git-send-email-alexanders83-S0/GAf8tV78@public.gmane.org>
2014-04-18 14:42 ` [PATCH] spi: atmel: Fix scheduling while atomic bug Mark Brown
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=1397385910-28368-1-git-send-email-alexanders83@web.de \
--to=alexanders83-s0/gaf8tv78@public.gmane.org \
--cc=broonie-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
--cc=linux-spi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nicolas.ferre-AIFe0yeh4nAAvxtiuMwx3w@public.gmane.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).