From: Maxime Bizon <mbizon@freebox.fr>
To: Florian Fainelli <florian@openwrt.org>
Cc: ralf@linux-mips.org, linux-mips@linux-mips.org,
spi-devel-general@lists.sourceforge.net,
Tanguy Bouzeloc <tanguy.bouzeloc@efixo.com>
Subject: Re: [PATCH v4] spi: add Broadcom BCM63xx SPI controller driver
Date: Wed, 01 Feb 2012 12:22:09 +0100 [thread overview]
Message-ID: <1328095329.4936.21.camel@sakura.staff.proxad.net> (raw)
In-Reply-To: <1328091249-10389-1-git-send-email-florian@openwrt.org>
On Wed, 2012-02-01 at 11:14 +0100, Florian Fainelli wrote:
Hi Florian,
> +struct bcm63xx_spi {
> + spinlock_t lock;
this lock is never actually used
it is referenced only once in device removal path
> + int stopping;
this can be removed by changing device removal path to first call
spi_unregister_master. that way the spi stack cannot call spi_transfer
anymore and we don't need to abort these calls.
> +static int bcm63xx_txrx_bufs(struct spi_device *spi, struct spi_transfer *t)
> +{
> [...]
> + bcm_spi_writew(bs, cmd, SPI_CMD);
> + wait_for_completion(&bs->done);
> +
bcm63xx_txrx_bufs() is called by bcm63xx_transfer(), and according to
Documentation/spi/spi-summary:
master->transfer(struct spi_device *spi, struct spi_message *message)
This must not sleep. Its responsibility is arrange that the
transfer happens and its complete() callback is issued. The two
will normally happen later, after other transfers complete, and
if the controller is idle it will need to be kickstarted.
So we cannot do a synchronous wait here, this must be pushed to a
workqueue or kthread.
--
Maxime
next prev parent reply other threads:[~2012-02-01 11:22 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-31 14:10 [PATCH 0/9 v3] MIPS: BCM63XX: add support for SPI Florian Fainelli
2012-01-31 14:10 ` [PATCH 1/9 v3] MIPS: BCM63XX: add IRQ_SPI and CPU specific SPI IRQ values Florian Fainelli
2012-01-31 14:10 ` [PATCH 2/9 v3] MIPS: BCM63XX: define BCM6358 SPI base address Florian Fainelli
2012-01-31 14:10 ` [PATCH 3/9 v3] MIPS: BCM63XX: add BCM6368 SPI clock mask Florian Fainelli
2012-01-31 14:10 ` [PATCH 4/9 v3] MIPS: BCM63XX: define SPI register sizes Florian Fainelli
2012-01-31 14:10 ` [PATCH 5/9 v3] MIPS: BCM63XX: remove SPI2 register Florian Fainelli
2012-01-31 14:10 ` [PATCH 6/9 v3] MIPS: BCM63XX: define internal registers offsets of the SPI controller Florian Fainelli
2012-01-31 14:10 ` [PATCH 7/9 v3] MIPS: BCM63XX: add stub to register the SPI platform driver Florian Fainelli
2012-01-31 14:10 ` [PATCH 8/9 v3] MIPS: BCM63XX: make board setup code register the spi platform device Florian Fainelli
2012-01-31 14:10 ` [PATCH 9/9 v3] spi: add Broadcom BCM63xx SPI controller driver Florian Fainelli
2012-01-31 20:19 ` Grant Likely
[not found] ` <20120131201922.GE22611-e0URQFbLeQY2iJbIjFUEsiwD8/FfD2ys@public.gmane.org>
2012-01-31 21:20 ` Florian Fainelli
[not found] ` <201201312220.41561.florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2012-01-31 21:59 ` Grant Likely
[not found] ` <1328019048-5892-10-git-send-email-florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2012-01-31 17:52 ` Shubhrajyoti Datta
2012-02-01 10:14 ` [PATCH v4] " Florian Fainelli
2012-02-01 11:22 ` Maxime Bizon [this message]
[not found] ` <1328091249-10389-1-git-send-email-florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2012-03-09 22:04 ` Grant Likely
2012-03-12 8:25 ` Florian Fainelli
[not found] ` <1328019048-5892-1-git-send-email-florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2012-05-30 10:04 ` [PATCH 0/9 v3] MIPS: BCM63XX: add support for SPI Florian Fainelli
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=1328095329.4936.21.camel@sakura.staff.proxad.net \
--to=mbizon@freebox.fr \
--cc=florian@openwrt.org \
--cc=linux-mips@linux-mips.org \
--cc=ralf@linux-mips.org \
--cc=spi-devel-general@lists.sourceforge.net \
--cc=tanguy.bouzeloc@efixo.com \
/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).