All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vignesh R <vigneshr@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 01/11] spi-mem: Claim SPI bus before spi mem access
Date: Mon, 28 Jan 2019 15:14:32 +0530	[thread overview]
Message-ID: <78e16114-95a6-b841-e952-552220a3b7d3@ti.com> (raw)
In-Reply-To: <CAMty3ZA6akzJof1wAs33WhTEY8=GwZC6rtJX2kfEWiV9SLdq9g@mail.gmail.com>



On 28/01/19 12:24 PM, Jagan Teki wrote:
> On Fri, Dec 21, 2018 at 12:08 PM Vignesh R <vigneshr@ti.com> wrote:
>>
>> It is necessary to call spi_claim_bus() before starting any SPI
>> transactions and this restriction would also apply when calling spi-mem
>> operationss. Therefore claim and release bus before requesting transfer
>> via exec_op.
>>
>> Signed-off-by: Vignesh R <vigneshr@ti.com>
>> ---
>>  drivers/spi/spi-mem.c | 6 ++++++
>>  1 file changed, 6 insertions(+)
>>
>> diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
>> index 1da20b8de5c4..4c1463118ab2 100644
>> --- a/drivers/spi/spi-mem.c
>> +++ b/drivers/spi/spi-mem.c
>> @@ -231,7 +231,13 @@ int spi_mem_exec_op(struct spi_slave *slave, const struct spi_mem_op *op)
>>                 mutex_lock(&ctlr->bus_lock_mutex);
>>                 mutex_lock(&ctlr->io_mutex);
>>  #endif
>> +               ret = spi_claim_bus(slave);
>> +               if (ret < 0)
>> +                       return ret;
>> +
>>                 ret = ops->mem_ops->exec_op(slave, op);
>> +
>> +               spi_release_bus(slave);
> 
> This making spi claims twice, since it's been doing before spi_xfer in
> below code. better to make it before the if.
> 

Ok, I will call it from common place

-- 
Regards
Vignesh

  reply	other threads:[~2019-01-28  9:44 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-21  6:38 [U-Boot] [PATCH v2 00/11] SF: Migrate to Linux SPI NOR framework Vignesh R
2018-12-21  6:38 ` [U-Boot] [PATCH v2 01/11] spi-mem: Claim SPI bus before spi mem access Vignesh R
2019-01-28  6:54   ` Jagan Teki
2019-01-28  9:44     ` Vignesh R [this message]
2018-12-21  6:38 ` [U-Boot] [PATCH v2 02/11] spi: Add non DM version of SPI_MEM Vignesh R
2018-12-21  6:38 ` [U-Boot] [PATCH v2 03/11] sh: bitops: add hweight*() macros Vignesh R
2018-12-21  6:38 ` [U-Boot] [PATCH v2 04/11] mtd: spi: Port SPI NOR framework from Linux Vignesh R
2019-01-27 18:48   ` Jagan Teki
2019-01-28 11:43     ` Vignesh R
2018-12-21  6:38 ` [U-Boot] [PATCH v2 05/11] mtd: spi: Switch to new SPI NOR framework Vignesh R
2018-12-21  6:38 ` [U-Boot] [PATCH v2 06/11] mtd: spi: Remove unused files Vignesh R
2018-12-21  6:38 ` [U-Boot] [PATCH v2 07/11] mtd: spi: Add lightweight SPI flash stack for SPL Vignesh R
2018-12-21  6:38 ` [U-Boot] [PATCH v2 08/11] configs: Enable SPI_FLASH_TINY for resource constrained boards Vignesh R
2018-12-21  6:38 ` [U-Boot] [PATCH v2 09/11] configs: Remove SF_DUAL_FLASH Vignesh R
2019-01-25 14:47   ` Jagan Teki
2019-01-25 15:01     ` Vignesh R
2019-01-28  6:36       ` Jagan Teki
2018-12-21  6:38 ` [U-Boot] [PATCH v2 10/11] configs: Don't use SPI_FLASH_BAR as default Vignesh R
2018-12-21  6:38 ` [U-Boot] [PATCH v2 11/11] MAINTAINERS: Add an entry for SPI NOR Vignesh R
2018-12-21  7:26 ` [U-Boot] [PATCH v2 00/11] SF: Migrate to Linux SPI NOR framework Stefan Roese
2018-12-21 10:33 ` Simon Goldschmidt
2018-12-21 11:11   ` Vignesh R
2018-12-21 13:29     ` Simon Goldschmidt
2018-12-22  7:43       ` Simon Goldschmidt
2019-01-09  9:26         ` Vignesh R
2019-01-14 15:02 ` Vignesh R
2019-01-14 15:05   ` Tom Rini
2019-01-21 11:58   ` Vignesh R
2019-01-21 12:10     ` Jagan Teki
2019-01-21 14:47       ` Vignesh R
2019-01-21 17:08         ` Tom Rini
2019-01-22  6:25           ` Stefan Roese
2019-01-21 17:14 ` Horatiu Vultur

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=78e16114-95a6-b841-e952-552220a3b7d3@ti.com \
    --to=vigneshr@ti.com \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.