mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rhyland Klein <rklein@nvidia.com>
To: Thierry Reding <thierry.reding@gmail.com>,
	Mark Rutland <mark.rutland@arm.com>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
	Lee Jones <lee.jones@linaro.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"rob.herring@calxeda.com" <rob.herring@calxeda.com>,
	Pawel Moll <Pawel.Moll@arm.com>,
	Ian Campbell <ijc+devicetree@hellion.org.uk>,
	Bernie Thompson <bhthompson@chromium.org>,
	Andrew Bresticker <abrestic@chromium.org>
Subject: Re: [PATCH 1/3] mfd: cros ec: spi: Add delay for raising CS
Date: Tue, 19 Nov 2013 12:06:07 -0500	[thread overview]
Message-ID: <528B9A7F.1040504@nvidia.com> (raw)
In-Reply-To: <20131119084223.GC31504@ulmo.nvidia.com>

On 11/19/2013 3:42 AM, Thierry Reding wrote:
> * PGP Signed by an unknown key
> 
> On Mon, Nov 18, 2013 at 11:48:10AM +0000, Mark Rutland wrote:
>> On Mon, Nov 18, 2013 at 10:30:47AM +0000, Thierry Reding wrote:
>>> From: Rhyland Klein <rklein@nvidia.com>
>>>
>>> The EC has specific timing it requires. Add support for an optional delay
>>> after raising CS to fix timing issues. This is configurable based on
>>> a DT property "google,cros-ec-spi-msg-delay".
>>>
>>> If this property isn't set, then no delay will be added. However, if set
>>> it will cause a delay equal to the value passed to it to be inserted at
>>> the end of a transaction.
>>>
>>> Signed-off-by: Rhyland Klein <rklein@nvidia.com>
>>> Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
>>> Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
>>> Cc: Rob Herring <rob.herring@calxeda.com>
>>> Cc: Pawel Moll <pawel.moll@arm.com>
>>> Cc: Mark Rutland <mark.rutland@arm.com>
>>> Cc: Ian Campbell <ijc+devicetree@hellion.org.uk>
>>> Signed-off-by: Thierry Reding <treding@nvidia.com>
>>> ---
>>>  Documentation/devicetree/bindings/mfd/cros-ec.txt |  4 +++
>>>  drivers/mfd/cros_ec_spi.c                         | 30 +++++++++++++++++++++++
>>>  2 files changed, 34 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/mfd/cros-ec.txt b/Documentation/devicetree/bindings/mfd/cros-ec.txt
>>> index 5f229c5f6da9..fb3034a87ae0 100644
>>> --- a/Documentation/devicetree/bindings/mfd/cros-ec.txt
>>> +++ b/Documentation/devicetree/bindings/mfd/cros-ec.txt
>>> @@ -17,6 +17,10 @@ Required properties (SPI):
>>>  - compatible: "google,cros-ec-spi"
>>>  - reg: SPI chip select
>>>  
>>> +Optional properties (SPI):
>>> +- google,cros-ec-spi-msg-delay: This property is how long of a delay, in usecs,
>>> +  to use on the last transfer of a message, to force time between transactions.
>>> +
>>
>> Lose the "This property is", that's obvious from the structure of the
>> document.
> 
> Will do.
> 
>> It would be nice to have an explanation in the binding document as to
>> _why_ you might want to do this (e.g. the HW expects the rising edge to
>> come some number of uS after the data, if it comes too early it
>> explodes).
> 
> From what I can tell, this might differ on the exact variant of the EC,
> but generally it seems that when the interval between two transactions
> isn't long enough the EC won't be able to respond properly in time and
> cause subsequent transactions to hang. Perhaps Rhyland, Bernie or Andrew
> are more familiar with the details and therefore can provide a better or
> more accurate explanation.

I believe this explanation is correct. As I recall, I think adding this
delay helped stabilize communication with the EC, where before sometimes
transactions would time out.

-rhyland

> 
>> Otherwise this looks fine to me.
> 
> Thanks,
> Thierry
> 
> * Unknown Key
> * 0x7F3EB3A1
> 


-- 
nvpublic

      reply	other threads:[~2013-11-19 17:06 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-18 10:30 Thierry Reding
2013-11-18 10:30 ` [PATCH 2/3] mfd: cros ec: spi: Increase EC transaction delay Thierry Reding
2013-11-18 10:43   ` Lee Jones
2013-11-18 18:55     ` dbasehore .
2013-11-18 19:01       ` Lee Jones
2013-11-18 10:30 ` [PATCH 3/3] mfd: cros ec: spi: Fix debug output Thierry Reding
2013-11-18 10:42   ` Lee Jones
2013-11-18 11:48 ` [PATCH 1/3] mfd: cros ec: spi: Add delay for raising CS Mark Rutland
2013-11-19  8:42   ` Thierry Reding
2013-11-19 17:06     ` Rhyland Klein [this message]

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=528B9A7F.1040504@nvidia.com \
    --to=rklein@nvidia.com \
    --cc=Pawel.Moll@arm.com \
    --cc=abrestic@chromium.org \
    --cc=bhthompson@chromium.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=rob.herring@calxeda.com \
    --cc=sameo@linux.intel.com \
    --cc=thierry.reding@gmail.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

Powered by JetHome