[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20151124170020.GE12874@x1>
Date: Tue, 24 Nov 2015 17:00:20 +0000
From: Lee Jones <lee.jones@...aro.org>
To: Nicolas Boichat <drinkcat@...omium.org>
Cc: linux-kernel@...r.kernel.org,
Javier Martinez Canillas <javier@....samsung.com>,
Olof Johansson <olof@...om.net>, dianders@...omium.org,
rspangler@...omium.org, gwendal@...omium.org,
linux-spi@...r.kernel.org, Mark Brown <broonie@...nel.org>
Subject: Re: [PATCH v2] mfd: cros ec: Lock the SPI bus while holding
chipselect
On Mon, 09 Nov 2015, Nicolas Boichat wrote:
> cros_ec_cmd_xfer_spi and cros_ec_pkt_xfer_spi generally work like
> this:
> - Pull CS down (active), wait a bit, then send a command
> - Wait for response (multiple requests)
> - Wait a while, pull CS up (inactive)
>
> These operations, individually, lock the SPI bus, but there is
> nothing preventing the SPI framework from interleaving messages
> intended for other devices as the bus is unlocked in between.
>
> This is a problem as the EC expects CS to be held low for the
> whole duration.
>
> Solution: Lock the SPI bus during the whole transaction, to make
> sure that no other messages can be interleaved.
>
> Signed-off-by: Nicolas Boichat <drinkcat@...omium.org>
> ---
>
> v2: Move bus_unlock earlier in the functions.
>
> Applies on top on linux-next/master (20151109)
>
> drivers/mfd/cros_ec_spi.c | 41 +++++++++++++++++++++++++++++------------
> 1 file changed, 29 insertions(+), 12 deletions(-)
Code changes look okay, but I think you can drop the comments.
--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org │ Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists