linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Mike Frysinger <vapier@gentoo.org>
Cc: spi-devel-general@lists.sourceforge.net,
	dbrownell@users.sourceforge.net, linux-kernel@vger.kernel.org,
	yi.li@analog.com
Subject: Re: [PATCH 2/2 v2] mmc_spi: lock the SPI bus when accessing the card
Date: Fri, 18 Sep 2009 14:30:54 -0700	[thread overview]
Message-ID: <20090918143054.a6cf31f7.akpm@linux-foundation.org> (raw)
In-Reply-To: <1253235134-25571-1-git-send-email-vapier@gentoo.org>

On Thu, 17 Sep 2009 20:52:14 -0400
Mike Frysinger <vapier@gentoo.org> wrote:

> From: Yi Li <yi.li@analog.com>
> 
> The MMC/SPI spec does not play well with typical SPI design -- it often
> needs to send out a command in one message, read a response, then do some
> other arbitrary step.  Since we can't let another SPI client use the bus
> during this time, use the new SPI lock/unlock functions to provide the
> required exclusivity.
> 
> Signed-off-by: Yi Li <yi.li@analog.com>
> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
> ---
> v2
> 	- drop now unused maybe_count_child as pointed out by H Hartley Sweeten
> 
>  drivers/mmc/host/mmc_spi.c |   41 ++---------------------------------------
>  1 files changed, 2 insertions(+), 39 deletions(-)
> 
> diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
> index a461017..c3563a7 100644
> --- a/drivers/mmc/host/mmc_spi.c
> +++ b/drivers/mmc/host/mmc_spi.c
> @@ -1084,6 +1084,7 @@ static void mmc_spi_request(struct mmc_host *mmc, struct mmc_request *mrq)
>  #endif
>  
>  	/* issue command; then optionally data and stop */
> +	spi_lock_bus(host->spi);
>  	status = mmc_spi_command_send(host, mrq, mrq->cmd, mrq->data != NULL);
>  	if (status == 0 && mrq->data) {
>  		mmc_spi_data_do(host, mrq->cmd, mrq->data, mrq->data->blksz);
> @@ -1092,7 +1093,7 @@ static void mmc_spi_request(struct mmc_host *mmc, struct mmc_request *mrq)
>  		else
>  			mmc_cs_off(host);
>  	}
> -
> +	spi_unlock_bus(host->spi);
>  	mmc_request_done(host->mmc, mrq);

I can't find any code anywhere which puts a non-zero value into
spi_master.[un]lock_bus so in my tree at least, neither of these
patches do anything.

This makes it all a bit hard to understand and review.

  reply	other threads:[~2009-09-18 21:30 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-17 22:03 [PATCH 1/2] spi: new SPI bus lock/unlock functions Mike Frysinger
2009-09-17 22:03 ` [PATCH 2/2] mmc_spi: lock the SPI bus when accessing the card Mike Frysinger
2009-09-18  0:29   ` [spi-devel-general] [PATCH 2/2] mmc_spi: lock the SPI bus whenaccessing " H Hartley Sweeten
2009-09-18  0:52     ` [PATCH 2/2 v2] mmc_spi: lock the SPI bus when accessing " Mike Frysinger
2009-09-18 21:30       ` Andrew Morton [this message]
2009-09-17 22:45 ` [spi-devel-general] [PATCH 1/2] spi: new SPI bus lock/unlockfunctions H Hartley Sweeten
2009-09-17 22:53   ` Mike Frysinger
2009-09-18 23:00     ` H Hartley Sweeten
2009-09-19 19:11       ` Mike Frysinger
2009-09-21  8:08       ` Li Yi
2009-09-18 21:29 ` [PATCH 1/2] spi: new SPI bus lock/unlock functions Andrew Morton
2009-09-21  6:33   ` Li Yi
2009-09-21 13:36     ` Mike Frysinger
2009-09-22 14:15 ` Mike Frysinger
2009-12-16 22:49 ` [spi-devel-general] [PATCH 1/2] spi: new SPI bus lock/unlockfunctions H Hartley Sweeten
2009-12-16 23:00   ` Mike Frysinger

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=20090918143054.a6cf31f7.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dbrownell@users.sourceforge.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=spi-devel-general@lists.sourceforge.net \
    --cc=vapier@gentoo.org \
    --cc=yi.li@analog.com \
    --subject='Re: [PATCH 2/2 v2] mmc_spi: lock the SPI bus when accessing the card' \
    /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

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).