All of lore.kernel.org
 help / color / mirror / Atom feed
From: Philipp Zabel <p.zabel@pengutronix.de>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: linux-kernel@vger.kernel.org,
	Vivek Gautam <vivek.gautam@codeaurora.org>,
	Jon Hunter <jonathanh@nvidia.com>,
	Felipe Balbi <balbi@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Thierry Reding <treding@nvidia.com>,
	linux-tegra@vger.kernel.org, linux-usb@vger.kernel.org,
	linux-arm-msm@vger.kernel.org, kernel@pengutronix.de
Subject: Re: [PATCH v7 1/4] reset: Add APIs to manage array of resets
Date: Thu, 02 Nov 2017 13:57:59 +0100	[thread overview]
Message-ID: <1509627479.10280.4.camel@pengutronix.de> (raw)
In-Reply-To: <20171101222418.GC28761@minitux>

Hi Bjorn,

On Wed, 2017-11-01 at 15:24 -0700, Bjorn Andersson wrote:
[...]
> > > This looks more or less identical to how regulators and clocks already
> > > deals with resources in bulk; see regulator_bulk_data and clk_bulk_data
> > > and their associated functions.
> > > 
> > > I would really like to see that you follow this model, to make it easier
> > > for developers to work with and use the various subsystems.
> > 
> > These APIs have two undesirable (in this case) properties; the driver
> > has to know the number of resets and their identifiers in advance, and
> > singular resets and bulk reset arrays can't be used interchangeably.
> 
> As a writer of device drivers as well as dts files I greatly appreciate
> when this expectations is encoded in the kernel, so that it is clear
> when the DT node is missing some resource - rather than having random
> reboots because of spelling mistakes or variations between hardware
> revisions.
> 
> We tend to express these things explicitly in the kernel, as magic
> interfaces makes things harder to debug.

I have no control over how most of those bindings are designed. While I
prefer bindings to explicitly specify resets by identifier where
possible, there are some generic bindings that just don't have this
information.
See for example the ohci/ehci-platform USB host drivers, which are used
for platform integration on various SoCs, or the Tegra pmc driver, which
has to handle resets for other peripherals when power gating.

Also, I currently don't see many drivers that would profit much from a
bulk API, as many drivers that request multiple reset controls have to
handle them individually anyway, to guarantee ordering or reset timings.
One candidate would be the pcie-qcom driver. If you are aware of more
potential users of a bulk API, please let me know.

> > Both are not well suited to this use case, which is "triggering one or
> > any number of anonymous resets together".
> > 
> 
> Triggering one is just a special case of N. 
>
> But this does not change the fact that the reset framework interface
> looks and function in a fundamentally different way than the clock and
> regulator equivalents, which will be confusing - in particular since
> most drivers will use 2 or 3 of these.

There is no way to make them work all exactly the same, as the resources
 themselves are used in different ways. Surely we should try to minimize
the API differences to allow transfer of expectations, but that should
not be the only goal.
For example neither clock nor regulator framework have support for
exclusive clocks/regulators that can be forced-off, and _optional
requests are handled differently in the gpio and regulator frameworks.

That being said, I'd be happy to add a bulk API if that actually helps
some drivers.

regards
Philipp

  reply	other threads:[~2017-11-02 12:57 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-19 15:59 [PATCH v7 0/4] reset: APIs to manage a list of resets Philipp Zabel
     [not found] ` <1500479948-29988-1-git-send-email-p.zabel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2017-07-19 15:59   ` [PATCH v7 1/4] reset: Add APIs to manage array " Philipp Zabel
2017-07-19 15:59     ` Philipp Zabel
2017-10-19 18:54     ` Bjorn Andersson
2017-10-20 12:20       ` Philipp Zabel
2017-11-01 22:24         ` Bjorn Andersson
2017-11-02 12:57           ` Philipp Zabel [this message]
2017-07-19 15:59   ` [PATCH v7 2/4] usb: dwc3: of-simple: Re-order resource handling in remove Philipp Zabel
2017-07-19 15:59     ` Philipp Zabel
2017-10-19  9:36     ` Felipe Balbi
2017-07-19 15:59   ` [PATCH v7 4/4] soc/tegra: pmc: Use the new reset APIs to manage reset controllers Philipp Zabel
2017-07-19 15:59     ` Philipp Zabel
2017-10-19 15:17     ` Philipp Zabel
     [not found]       ` <1508426260.7665.24.camel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2017-10-20 15:51         ` Jon Hunter
2017-10-20 15:51           ` Jon Hunter
2017-10-23  9:20           ` Philipp Zabel
2018-03-09  8:09     ` Thierry Reding
2017-07-19 15:59 ` [PATCH v7 3/4] usb: dwc3: of-simple: Add support to get resets for the device Philipp Zabel
2017-10-19  9:38   ` Felipe Balbi
2017-10-19  9:38     ` Felipe Balbi
     [not found]     ` <87y3o7h3zu.fsf-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-10-19 10:45       ` Philipp Zabel
2017-10-19 10:45         ` Philipp Zabel
2017-10-19 11:30         ` Felipe Balbi
     [not found]         ` <1508409939.7665.7.camel-bIcnvbaLZ9MEGnE8C9+IrQ@public.gmane.org>
2017-10-19 11:31           ` Felipe Balbi
2017-10-19 11:31             ` Felipe Balbi
     [not found]             ` <87shefgyqc.fsf-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
2017-10-19 11:47               ` Philipp Zabel
2017-10-19 11:47                 ` 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=1509627479.10280.4.camel@pengutronix.de \
    --to=p.zabel@pengutronix.de \
    --cc=balbi@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jonathanh@nvidia.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tegra@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=treding@nvidia.com \
    --cc=vivek.gautam@codeaurora.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.