devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Stephen Warren <swarren@wwwdotorg.org>
Cc: Marek Vasut <marex@denx.de>,
	Fabio Estevam <fabio.estevam@freescale.com>,
	Mike Turquette <mturquette@linaro.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	kernel@pengutronix.de, Shawn Guo <shawn.guo@linaro.org>,
	devicetree-discuss@lists.ozlabs.org,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v3 2/8] reset: Add reset controller API
Date: Wed, 20 Feb 2013 12:04:20 +0100	[thread overview]
Message-ID: <1361358260.4937.26.camel@pizza.hi.pengutronix.de> (raw)
In-Reply-To: <5123F112.7050105@wwwdotorg.org>

Hi,

Am Dienstag, den 19.02.2013, 14:39 -0700 schrieb Stephen Warren:
> On 02/19/2013 04:35 AM, Philipp Zabel wrote:
> > This adds a simple API for devices to request being reset
> > by separate reset controller hardware and implements the
> > reset signal device tree binding.
> 
> I know I apparently already reviewed this before, but I have a couple
> small comments to make.

this is my fault. I added the Kconfig comment only after you looked at
the patches. Same for the change in reset_control_get below, which is
change enough to argue I should have dropped the Reviewed-by.

> When I first posted my binding proposal for this, someone said it might
> make sense to integrate the reset logic into the existing power domains
> support. I think that's drivers/base/power/. It might be worth Cc'ing
> the maintainers of that code in case they have comments.

For devices that change their power domain related state during a reset,
some kind of integration could be needed.

> > diff --git a/drivers/Makefile b/drivers/Makefile
> 
> > +# reset controllers early, since gpu drivers might rely on them to initialize
> > +obj-$(CONFIG_RESET_CONTROLLER)	+= reset/
>
> That sounds odd now. Shouldn't -EPROBE_DEFERRED sort out any ordering
> issues?

Even so, isn't it useful to avoid the -EPROBE_DEFERRED loop when we
expect other drivers to depend on resources provided by the reset
controller drivers, but not the other way around?

> diff --git a/drivers/reset/core.c b/drivers/reset/core.c
> 
> > +struct reset_control *reset_control_get(struct device *dev, const char *id)
> ...
> > +	rstc->rcdev = rcdev;
> > +	rstc->id = args.args[0];
> 
> If the length of args < 1, then that will copy garbage data.

Will fix.

> This code will probably work fine for now, but in general, you want to
> call a function in the reset controller itself to translate from args to
> the reset controller ID. This will allow individual reset controllers to
> use a strange mapping for IDs, store flags in the DT cells that
> configure the reset (e.g. how long it should be asserted), etc. May as
> well add that now. You can add a common implementation that most simple
> drivers can use, rather like of_gpio_simple_xlate().

I wanted to keep it simple in the first round, but I agree. It might be
helpful to add it from the beginning.

> > diff --git a/include/linux/reset.h b/include/linux/reset.h
> 
> > +struct reset_control *devm_reset_control_get(struct device *dev, const char *id);
> 
> You might want an explicit devm_reset_control_put() too. It's unlikely
> it'd get much use, but at least some of the other devm_* functions do
> have manual put functions available too.

Ok.

thanks
Philipp

  reply	other threads:[~2013-02-20 11:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-02-19 11:35 [PATCH v3 0/8] Reset controller API to reset IP modules on i.MX5 and i.MX6 Philipp Zabel
     [not found] ` <1361273732-23357-1-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-02-19 11:35   ` [PATCH v3 1/8] dt: describe base reset signal binding Philipp Zabel
2013-02-19 11:35   ` [PATCH v3 2/8] reset: Add reset controller API Philipp Zabel
     [not found]     ` <1361273732-23357-3-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-02-19 21:39       ` Stephen Warren
2013-02-20 11:04         ` Philipp Zabel [this message]
     [not found]           ` <1361358260.4937.26.camel-/rZezPiN1rtR6QfukMTsflXZhhPuCNm+@public.gmane.org>
2013-02-20 17:10             ` Stephen Warren
2013-02-20  2:20       ` Shawn Guo
2013-02-19 11:35   ` [PATCH v3 3/8] ARM i.MX6q: Add GPU, VPU, IPU, and OpenVG resets to System Reset Controller (SRC) Philipp Zabel
     [not found]     ` <1361273732-23357-4-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-02-19 21:41       ` Stephen Warren
2013-02-19 11:35   ` [PATCH v3 4/8] ARM i.MX6q: Link system reset controller (SRC) to IPU in DT Philipp Zabel
2013-02-19 11:35   ` [PATCH v3 5/8] staging: drm/imx: Use SRC to reset IPU Philipp Zabel
2013-02-19 11:35   ` [PATCH v3 6/8] ARM i.MX5: Add System Reset Controller (SRC) support for i.MX51 and i.MX53 Philipp Zabel
2013-02-19 11:35   ` [PATCH v3 7/8] ARM i.MX5: Add system reset controller (SRC) to i.MX51 and i.MX53 device tree Philipp Zabel
2013-02-19 11:35   ` [PATCH v3 8/8] reset: Add driver for gpio-controlled reset pins Philipp Zabel
     [not found]     ` <1361273732-23357-9-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2013-02-19 21:57       ` Stephen Warren
     [not found]         ` <5123F541.4020407-3lzwWm7+Weoh9ZMKESR00Q@public.gmane.org>
2013-02-20 11:22           ` Philipp Zabel
     [not found]             ` <1361359326.4937.38.camel-/rZezPiN1rtR6QfukMTsflXZhhPuCNm+@public.gmane.org>
2013-02-20 17:14               ` Stephen Warren
2013-02-19 21:23   ` [PATCH v3 0/8] Reset controller API to reset IP modules on i.MX5 and i.MX6 Stephen Warren

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=1361358260.4937.26.camel@pizza.hi.pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=devicetree-discuss@lists.ozlabs.org \
    --cc=fabio.estevam@freescale.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=marex@denx.de \
    --cc=mturquette@linaro.org \
    --cc=s.hauer@pengutronix.de \
    --cc=shawn.guo@linaro.org \
    --cc=swarren@wwwdotorg.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).