public inbox for linux-arm-kernel@lists.infradead.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: Why do we need reset_control_get_optional() ?
Date: Thu, 28 Jul 2016 12:09:25 +0200	[thread overview]
Message-ID: <5955443.3UvZHD6laK@wuerfel> (raw)
In-Reply-To: <1469698980.12835.18.camel@pengutronix.de>

On Thursday, July 28, 2016 11:43:00 AM CEST Philipp Zabel wrote:
> > I want to deprecate _optional variants in the following steps:
> > 
> > [1] Add "depends on RESET_CONTROLLER" to drivers
> >     for which reset_control is mandatory.
> > 
> >     We can find those driver easily by grepping
> >     the reference to non-optional reset_control_get().
> 
> Since we have the stubs, the RESET_CONTROLLER dependency is only at
> runtime, not at build time.
> 
> I think Arnd wanted to move this in the opposite direction and remove
> the configurable RESET_CONTROLLER symbol. Maybe we should let all
> drivers that currently request non-optional resets have:
>         depends on (ARCH_HAS_)RESET_CONTROLLER || COMPILE_TEST
> ?

There are various ways to improve the current situation.

I think it's important that a driver that has an optional
reset line behaves in exactly the same way whether the reset
subsystem is enabled or disabled when no reset line is
provided for a machine.

When a driver requires a reset line, we can either have a
build-time failure when the reset subsystem is disabled
(enforcing the Kconfig dependency), or cause a runtime
failure if either there is no reset line or the subsystem
is disabled.

In my experimental patch, I make the _optional functions
return NULL if no "resets" property is provided but return
an error if there are reset lines but the subsystem is
disabled, i.e. an optional reset must be used if it's in the
DT, but can be ignored otherwise.

	Arnd

  reply	other threads:[~2016-07-28 10:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-23 11:22 Why do we need reset_control_get_optional() ? Masahiro Yamada
2016-07-28  9:43 ` Philipp Zabel
2016-07-28 10:09   ` Arnd Bergmann [this message]
2016-07-28 10:52     ` Masahiro Yamada
2016-07-28 11:00       ` Philipp Zabel
2016-08-05 15:50         ` Arnd Bergmann
2016-08-08 16:39           ` Philipp Zabel
2016-08-08 21:39             ` Arnd Bergmann
2016-08-16 14:36             ` Masahiro Yamada
2016-08-24  6:58               ` Masahiro Yamada
2016-08-24 12:30                 ` Philipp Zabel
2016-07-28 10:56     ` Philipp Zabel
2016-07-28 10:29   ` Masahiro Yamada
2016-07-29 13:08     ` Philipp Zabel
2016-07-30 20:13       ` Arnd Bergmann
2016-08-05  8:55         ` Philipp Zabel
2016-08-05 15:35           ` Arnd Bergmann
2016-08-08 17:29             ` Philipp Zabel
2016-08-16  9:41             ` Masahiro Yamada
2016-08-24 13:29               ` Philipp Zabel

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=5955443.3UvZHD6laK@wuerfel \
    --to=arnd@arndb.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