linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Lee Jones <lee.jones@linaro.org>
Cc: Zubair Lutfullah <zubair.lutfullah@gmail.com>,
	sameo@linux.intel.com, linux-kernel@vger.kernel.org,
	gregkh@linuxfoundation.org
Subject: Re: [PATCH] mfd: ti_am335x_tscadc: fix spin lock and reg_cache
Date: Tue, 22 Oct 2013 18:38:39 +0200	[thread overview]
Message-ID: <5266AA0F.1030603@linutronix.de> (raw)
In-Reply-To: <20131022160523.GB24024@lee--X1>

On 10/22/2013 06:05 PM, Lee Jones wrote:
>> I added reg_se_cache to cache the content of REG_SE once and
>> synchronize it among TSC & ADC access. REG_SE is set to 0 by the HW
>> after "work" has been done. So you need to know the old value or TSC may
>> disable ADC and the other way around.
> 
> Yep, it's initialised as '0'.
> 
> 12.5.1.15 STEPENABLE Register (offset = 54h) [reset = 0h]

Ehm yes but!. After init it is set to 0, correct. The value was never
read from the HW. It was always set via  am335x_tsc_se_set() to "cache
| argument" and written to HW from both sides (TSC, ADC). This
initialization is done at ->probe() time in both drivers.

The value remains (remained) constant over the whole time
so both drivers only called am335x_tsc_se_update() to set the value
(the enabled steps of both sides) back to the register (because after
the conversation the value was 0 according to my memory) and since
32bit reads are atomic I didn't use a lock here.

Sebastian

  reply	other threads:[~2013-10-22 16:38 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-05 19:10 [PATCH] mfd: ti_am335x_tscadc: fix spin lock and reg_cache Zubair Lutfullah
2013-08-07  8:40 ` Lee Jones
2013-10-22 13:15   ` Sebastian Andrzej Siewior
2013-10-22 15:48     ` Lee Jones
2013-10-22 16:28       ` Sebastian Andrzej Siewior
2013-10-25 15:53         ` Zubair Lutfullah :
2013-10-22 16:05     ` Lee Jones
2013-10-22 16:38       ` Sebastian Andrzej Siewior [this message]
2013-10-22 17:06         ` Lee Jones
2013-10-22 17:17           ` Sebastian Andrzej Siewior
2013-10-22 17:36             ` Lee Jones

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=5266AA0F.1030603@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=lee.jones@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    --cc=zubair.lutfullah@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;
as well as URLs for NNTP newsgroup(s).