From: Simon Kagstrom <simon.kagstrom@gmail.com>
To: Balaji Rao <balajirrao@openmoko.org>
Cc: linux-kernel@vger.kernel.org,
David Brownell <dbrownell@users.sourceforge.net>,
Andy Green <andy@openmoko.com>,
spi-devel-general@lists.sourceforge.net
Subject: Re: [PATCH 2/2] spi_bitbang: Add support for non-blocking synchronous transfers
Date: Sat, 28 Feb 2009 10:09:14 +0100 [thread overview]
Message-ID: <20090228100914.2ec2ff7f@lska2> (raw)
In-Reply-To: <20090228081117.31964.51155.stgit@fedora.yogi>
Thanks for taking this up Balaji!
In the comment below I'm assuming the Openmoko accelerometer use of
this functionality, which would include doing SPI transfers in the
interrupt handler.
On Sat, 28 Feb 2009 13:41:17 +0530
Balaji Rao <balajirrao@openmoko.org> wrote:
> +/* Synchronous non blocking transfer */
> +int
> +spi_bitbang_transfer_sync(struct spi_device *spi, struct spi_message
> *m) +{
> [...]
> + if (setup_transfer) {
> + status = setup_transfer(spi, t);
> [...]
> + if (!m->is_dma_mapped)
> + t->rx_dma = t->tx_dma = 0;
> + status = bitbang->txrx_bufs(spi, t);
Another thing that we'd need to take care of is that the stuff being
called from the synhronous transfer is actually callable from interrupt
context. Looking at txrx_bufs for s3c24xx (s3c24xx_spi_txrx), it's
using a wait_for_completion which is in turn completed by the s3c24xx
SPI interrupt handler.
Without trying, I'm guessing that that won't be possible from interrupt
context.
// Simon
next prev parent reply other threads:[~2009-02-28 9:09 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-02-28 8:10 [PATCH 0/2] spi: Add support for non-blocking synchronous transfers Balaji Rao
2009-02-28 8:10 ` [PATCH 1/2] " Balaji Rao
2009-02-28 8:11 ` [PATCH 2/2] spi_bitbang: " Balaji Rao
2009-02-28 9:09 ` Simon Kagstrom [this message]
2009-02-28 9:58 ` Balaji Rao
2009-02-28 10:15 ` Simon Kagstrom
2009-02-28 10:59 ` Balaji Rao
2009-02-28 20:33 ` [PATCH 0/2] spi: " David Brownell
2009-02-28 22:12 ` Balaji Rao
2009-02-28 23:19 ` David Brownell
2009-03-01 5:11 ` Balaji Rao
2009-03-01 9:49 ` David Brownell
2009-03-01 10:23 ` Balaji Rao
2009-03-01 7:48 ` Andy Green
2009-03-01 9:43 ` David Brownell
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=20090228100914.2ec2ff7f@lska2 \
--to=simon.kagstrom@gmail.com \
--cc=andy@openmoko.com \
--cc=balajirrao@openmoko.org \
--cc=dbrownell@users.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=spi-devel-general@lists.sourceforge.net \
/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