linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Grant Likely <grant.likely-s3s/WqlpOiPyB63q8FvJNQ@public.gmane.org>
To: Jonas Gorski <jogo-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Cc: Maxime Bizon <mbizon-MmRyKUhfbQ9GWvitb5QawA@public.gmane.org>,
	Mark Brown
	<broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>,
	Florian Fainelli
	<florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>,
	Kevin Cernekee <cernekee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH V2 0/2] spi/bcm63xx: fix multi transfer messages
Date: Tue, 05 Feb 2013 14:30:40 +0000	[thread overview]
Message-ID: <20130205143040.208603E1265@localhost> (raw)
In-Reply-To: <1359900913-4472-1-git-send-email-jogo-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>

On Sun,  3 Feb 2013 15:15:11 +0100, Jonas Gorski <jogo-p3rKhJxN3npAfugRpC6u6w@public.gmane.org> wrote:
> The bcm63xx SPI controller does not support keeping CS up after doing a
> transfer. Since this is problematic for most typical use cases, this
> patchset introduces a workaround by combining small enough messages
> to one transfer, rejecting anything that can't be fulfilled with the
> hardware.
> 
> Patch one properly rejects anything impossible to transfer with these
> limitations.
> Patch two introduces logic for combining transfers to one to be able to
> use it for typical use cases (register accesses and flash access).
> 
> Build and run tested on a BCM6368 with a SPI controlled switch attached
> requiring write-then-read with CS asserted.
> 
> Changes V1 -> V2:
>  * split into two patches
>  * fixed return type of bcm63xx_txrx_bufs()
>  * slightly reworked bcm63xx_txrx_bufs, obsoleting one local variable
>  * added a bit more comments in the code
>  * added error messages indicated why transfers were rejected

Another option is to allow longer transfers if a GPIO is used for the CS
line. A lot of SPI controllers need to do that.

That isn't a critique of this patch because it is essentially a bug fix,
but rather a way you can work around the limitation.

g.

> 
> Jonas Gorski (2):
>   spi/bcm63xx: reject transfers unable to transfer
>   spi/bcm63xx: work around inability to keep CS up
> 
>  drivers/spi/spi-bcm63xx.c |  179 +++++++++++++++++++++++++++++++--------------
>  1 file changed, 125 insertions(+), 54 deletions(-)
> 
> -- 
> 1.7.10.4
> 

-- 
Grant Likely, B.Sc, P.Eng.
Secret Lab Technologies, Ltd.

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb

  parent reply	other threads:[~2013-02-05 14:30 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-03 14:15 [PATCH V2 0/2] spi/bcm63xx: fix multi transfer messages Jonas Gorski
     [not found] ` <1359900913-4472-1-git-send-email-jogo-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2013-02-03 14:15   ` [PATCH V2 1/2] spi/bcm63xx: reject transfers unable to transfer Jonas Gorski
     [not found]     ` <1359900913-4472-2-git-send-email-jogo-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2013-02-05 14:32       ` Grant Likely
2013-02-03 14:15   ` [PATCH V2 2/2] spi/bcm63xx: work around inability to keep CS up Jonas Gorski
     [not found]     ` <1359900913-4472-3-git-send-email-jogo-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2013-02-05 14:35       ` Grant Likely
2013-02-05 15:00         ` Jonas Gorski
     [not found]           ` <20130205160004.2817a8b08ba7bb8c2de9a382-p3rKhJxN3npAfugRpC6u6w@public.gmane.org>
2013-02-05 17:14             ` Grant Likely
2013-02-04 13:29   ` [PATCH V2 0/2] spi/bcm63xx: fix multi transfer messages Florian Fainelli
2013-02-05 14:30   ` Grant Likely [this message]
     [not found]     ` <20130205150441.GC4720@opensource.wolfsonmicro.com>
     [not found]       ` <20130205150441.GC4720-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org>
2013-02-05 17:14         ` Grant Likely

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=20130205143040.208603E1265@localhost \
    --to=grant.likely-s3s/wqlpoipyb63q8fvjnq@public.gmane.org \
    --cc=broonie-yzvPICuk2AATkU/dhu1WVueM+bqZidxxQQ4Iyu8u01E@public.gmane.org \
    --cc=cernekee-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=florian-p3rKhJxN3npAfugRpC6u6w@public.gmane.org \
    --cc=jogo-p3rKhJxN3npAfugRpC6u6w@public.gmane.org \
    --cc=mbizon-MmRyKUhfbQ9GWvitb5QawA@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@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).