linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: p.zabel@pengutronix.de (Philipp Zabel)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v2] i2c: designware: add reset interface
Date: Fri, 23 Dec 2016 11:26:32 +0100	[thread overview]
Message-ID: <1482488792.2394.21.camel@pengutronix.de> (raw)
In-Reply-To: <49a5d8a4-864e-e80e-eee0-57c876d25aaf@linaro.org>

Hi Zhangfei,

Am Freitag, den 16.12.2016, 11:01 +0800 schrieb zhangfei:
> Hi, Philipp
> 
> On 2016?12?16? 10:45, zhangfei wrote:
[...]
> Sorry, a bit confused.
> Is that mean we should not use devm_reset_control_get_optional()
> While driver should decide whether use 
> devm_reset_control_get_optional_exclusive() or
> devm_reset_control_get_optional_shared()
> What if different platform has different requirement?
> 
> Looks the difference between _exclusive and _shared is refcount,
> How about handle this inside, and not decided by interface?

Because there is a significant difference in how the actual reset line
behaves. The shared resets are clock-like, and should only be used if
the device needs them to be deasserted to be enabled, but is fine if
they have been deasserted earlier or if they are not immediately
asserted after the device is disabled, but some time later.
For the shared / non-exclusive resets calling reset_control_assert and
then reset_control_deassert is not guaranteed to do anything at all,
because another user of the reset line could keep it deasserted.

If the device needs a reset to be issued at a certain point in time on
the other hand, for example to reset its state machine or registers to a
known good state, calling assert must guarantee to actually assert the
reset. This can only be done if the reset is exclusive.

Whether guaranteed asserts (exclusive reset lines) are necessary depends
on the device, so this decision has to be made in the driver.

regards
Philipp

  reply	other threads:[~2016-12-23 10:26 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-22  4:41 [PATCH] i2c: designware: add reset interface Zhangfei Gao
2016-12-13 20:34 ` Wolfram Sang
2016-12-14 19:00   ` Andy Shevchenko
2016-12-15  8:56     ` zhangfei
2016-12-15  8:59 ` [PATCH v2] " Zhangfei Gao
2016-12-15 12:33   ` Andy Shevchenko
2016-12-15 14:11     ` Phil Reid
2016-12-15 15:40       ` Jarkko Nikula
2016-12-15 15:30     ` Ramiro Oliveira
2016-12-16  2:45       ` zhangfei
2016-12-16  3:01         ` zhangfei
2016-12-23 10:26           ` Philipp Zabel [this message]
2016-12-23 13:39             ` zhangfei

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=1482488792.2394.21.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    /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).