All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Chen <hzpeterchen-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Ulf Hansson <ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Peter Chen <peter.chen-3arQi8VN3Tc@public.gmane.org>,
	Mark Rutland <mark.rutland-5wv7dgnIgG8@public.gmane.org>,
	Heiko Stuebner <heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org>,
	Stephen Boyd
	<stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	frank.li-3arQi8VN3Tc@public.gmane.org,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Gary Bisson
	<gary.bisson-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org>,
	Fabio Estevam <festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Joshua Clayton
	<stillcompiling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
	Dmitry Eremin-Solenikov
	<dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	Vaibhav Hiremath
	<vaibhav.hiremath-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Krzysztof Kozlowski
	<krzk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	mka-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org,
	Alan Stern
	<stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"Maciej S. Szmigiero"
	<mail-APzI5cXaD1zVlRWJc41N0YvC60bnQu0Y@public.gmane.org>,
	Pawel Moll <pawel.moll-5wv7dgnIgG8@public.gmane.org>,
	"linux-pm-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-pm-u79uwXL29TY@public.gmane.org>
Subject: Re: [PATCH v15 2/7] power: add power sequence library
Date: Wed, 14 Jun 2017 09:53:39 +0800	[thread overview]
Message-ID: <20170614015338.GA4635@b29397-desktop> (raw)
In-Reply-To: <CAPDyKFpOQWTPpdd__OBP1DcW58CbqnygGAOxiEFq5kqqvCm0QA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Tue, Jun 13, 2017 at 12:24:42PM +0200, Ulf Hansson wrote:
> [...]
> 
> > +
> > +/**
> > + * of_pwrseq_on - Carry out power sequence on for device node
> > + *
> > + * @np: the device node would like to power on
> > + *
> > + * Carry out a single device power on.  If multiple devices
> > + * need to be handled, use of_pwrseq_on_list() instead.
> > + *
> > + * Return a pointer to the power sequence instance on success,
> > + * or an error code otherwise.
> > + */
> > +struct pwrseq *of_pwrseq_on(struct device_node *np)
> > +{
> > +       struct pwrseq *pwrseq;
> > +       int ret;
> > +
> > +       pwrseq = pwrseq_find_available_instance(np);
> > +       if (!pwrseq)
> > +               return ERR_PTR(-ENOENT);
> 
> In case the pwrseq instance hasn't been registered yet, then there is
> no way to deal with -EPROBE_DEFER properly here.
> 
> I haven't been following the discussions in-depth during all
> iterations, so perhaps you have already discussed why doing it like
> this.

Yes, it has been discussed. In order to compare with compatible string
at dts, we need to have one registered pwrseq instance for each
pwrseq library, this pre-registered one is allocated using
postcore_initcall, and the new (eg, second) instance is registered
after pwrseq_get has succeeded.

Peter

> 
> Anyway, that means all pwrseq instances needs to be registered an
> early boot level, to be safe. To me, that seems like poor design
> choice.
> 
> Otherwise I think this looks okay to me.
> 

-- 

Best Regards,
Peter Chen
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

WARNING: multiple messages have this Message-ID (diff)
From: hzpeterchen@gmail.com (Peter Chen)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v15 2/7] power: add power sequence library
Date: Wed, 14 Jun 2017 09:53:39 +0800	[thread overview]
Message-ID: <20170614015338.GA4635@b29397-desktop> (raw)
In-Reply-To: <CAPDyKFpOQWTPpdd__OBP1DcW58CbqnygGAOxiEFq5kqqvCm0QA@mail.gmail.com>

On Tue, Jun 13, 2017 at 12:24:42PM +0200, Ulf Hansson wrote:
> [...]
> 
> > +
> > +/**
> > + * of_pwrseq_on - Carry out power sequence on for device node
> > + *
> > + * @np: the device node would like to power on
> > + *
> > + * Carry out a single device power on.  If multiple devices
> > + * need to be handled, use of_pwrseq_on_list() instead.
> > + *
> > + * Return a pointer to the power sequence instance on success,
> > + * or an error code otherwise.
> > + */
> > +struct pwrseq *of_pwrseq_on(struct device_node *np)
> > +{
> > +       struct pwrseq *pwrseq;
> > +       int ret;
> > +
> > +       pwrseq = pwrseq_find_available_instance(np);
> > +       if (!pwrseq)
> > +               return ERR_PTR(-ENOENT);
> 
> In case the pwrseq instance hasn't been registered yet, then there is
> no way to deal with -EPROBE_DEFER properly here.
> 
> I haven't been following the discussions in-depth during all
> iterations, so perhaps you have already discussed why doing it like
> this.

Yes, it has been discussed. In order to compare with compatible string
at dts, we need to have one registered pwrseq instance for each
pwrseq library, this pre-registered one is allocated using
postcore_initcall, and the new (eg, second) instance is registered
after pwrseq_get has succeeded.

Peter

> 
> Anyway, that means all pwrseq instances needs to be registered an
> early boot level, to be safe. To me, that seems like poor design
> choice.
> 
> Otherwise I think this looks okay to me.
> 

-- 

Best Regards,
Peter Chen

WARNING: multiple messages have this Message-ID (diff)
From: Peter Chen <hzpeterchen@gmail.com>
To: Ulf Hansson <ulf.hansson@linaro.org>
Cc: Peter Chen <peter.chen@nxp.com>,
	Mark Rutland <mark.rutland@arm.com>,
	Heiko Stuebner <heiko@sntech.de>,
	Stephen Boyd <stephen.boyd@linaro.org>, <frank.li@nxp.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Gary Bisson <gary.bisson@boundarydevices.com>,
	Fabio Estevam <festevam@gmail.com>,
	Joshua Clayton <stillcompiling@gmail.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>,
	Vaibhav Hiremath <vaibhav.hiremath@linaro.org>,
	Krzysztof Kozlowski <krzk@kernel.org>, <mka@chromium.org>,
	Alan Stern <stern@rowland.harvard.edu>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"Maciej S. Szmigiero" <mail@maciej.szmigiero.name>,
	Pawel Moll <pawel.moll@arm.com>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Sascha Hauer <s.hauer@pengutronix.de>,
	<troy.kisky@boundarydevices.com>,
	Rob Herring <robh+dt@kernel.org>,
	"linux-arm-kernel@lists.infradead.org" 
	<linux-arm-kernel@lists.infradead.org>, <hverkuil@xs4all.nl>,
	<oscar@naiandei.net>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Linux USB List <linux-usb@vger.kernel.org>,
	"Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Sebastian Reichel <sre@kernel.org>,
	Mark Brown <broonie@kernel.org>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Shawn Guo <shawnguo@kernel.org>, <jun.li@nxp.com>
Subject: Re: [PATCH v15 2/7] power: add power sequence library
Date: Wed, 14 Jun 2017 09:53:39 +0800	[thread overview]
Message-ID: <20170614015338.GA4635@b29397-desktop> (raw)
In-Reply-To: <CAPDyKFpOQWTPpdd__OBP1DcW58CbqnygGAOxiEFq5kqqvCm0QA@mail.gmail.com>

On Tue, Jun 13, 2017 at 12:24:42PM +0200, Ulf Hansson wrote:
> [...]
> 
> > +
> > +/**
> > + * of_pwrseq_on - Carry out power sequence on for device node
> > + *
> > + * @np: the device node would like to power on
> > + *
> > + * Carry out a single device power on.  If multiple devices
> > + * need to be handled, use of_pwrseq_on_list() instead.
> > + *
> > + * Return a pointer to the power sequence instance on success,
> > + * or an error code otherwise.
> > + */
> > +struct pwrseq *of_pwrseq_on(struct device_node *np)
> > +{
> > +       struct pwrseq *pwrseq;
> > +       int ret;
> > +
> > +       pwrseq = pwrseq_find_available_instance(np);
> > +       if (!pwrseq)
> > +               return ERR_PTR(-ENOENT);
> 
> In case the pwrseq instance hasn't been registered yet, then there is
> no way to deal with -EPROBE_DEFER properly here.
> 
> I haven't been following the discussions in-depth during all
> iterations, so perhaps you have already discussed why doing it like
> this.

Yes, it has been discussed. In order to compare with compatible string
at dts, we need to have one registered pwrseq instance for each
pwrseq library, this pre-registered one is allocated using
postcore_initcall, and the new (eg, second) instance is registered
after pwrseq_get has succeeded.

Peter

> 
> Anyway, that means all pwrseq instances needs to be registered an
> early boot level, to be safe. To me, that seems like poor design
> choice.
> 
> Otherwise I think this looks okay to me.
> 

-- 

Best Regards,
Peter Chen

  parent reply	other threads:[~2017-06-14  1:53 UTC|newest]

Thread overview: 63+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-13  1:59 [PATCH v15 0/7] power: add power sequence library Peter Chen
2017-06-13  1:59 ` Peter Chen
2017-06-13  1:59 ` Peter Chen
2017-06-13  1:59 ` [PATCH v15 1/7] binding-doc: power: pwrseq-generic: add binding doc for generic " Peter Chen
2017-06-13  1:59   ` Peter Chen
2017-06-13  1:59   ` Peter Chen
2017-06-13  1:59 ` [PATCH v15 2/7] power: add " Peter Chen
2017-06-13  1:59   ` Peter Chen
2017-06-13  1:59   ` Peter Chen
2017-06-13 10:24   ` Ulf Hansson
2017-06-13 10:24     ` Ulf Hansson
2017-06-13 10:24     ` Ulf Hansson
     [not found]     ` <CAPDyKFpOQWTPpdd__OBP1DcW58CbqnygGAOxiEFq5kqqvCm0QA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-14  1:53       ` Peter Chen [this message]
2017-06-14  1:53         ` Peter Chen
2017-06-14  1:53         ` Peter Chen
2017-06-14  8:53         ` Ulf Hansson
2017-06-14  8:53           ` Ulf Hansson
2017-06-14  8:53           ` Ulf Hansson
2017-06-15  6:58           ` Peter Chen
2017-06-15  6:58             ` Peter Chen
2017-06-15  6:58             ` Peter Chen
2017-06-15  8:11             ` Ulf Hansson
2017-06-15  8:11               ` Ulf Hansson
2017-06-15  8:11               ` Ulf Hansson
     [not found]               ` <CAPDyKFpc8GRKK8bafMU_HPaqWNrger3grPSd5rWWCTYhUGHZLA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2017-06-15  9:11                 ` Peter Chen
2017-06-15  9:11                   ` Peter Chen
2017-06-15  9:11                   ` Peter Chen
2017-06-15  9:35                   ` Ulf Hansson
2017-06-15  9:35                     ` Ulf Hansson
2017-06-15  9:35                     ` Ulf Hansson
2017-06-15 10:06                     ` Peter Chen
2017-06-15 10:06                       ` Peter Chen
2017-06-15 10:06                       ` Peter Chen
2017-06-19  0:59                       ` Peter Chen
2017-06-19  0:59                         ` Peter Chen
2017-06-19  0:59                         ` Peter Chen
2017-06-19  8:09                       ` Ulf Hansson
2017-06-19  8:09                         ` Ulf Hansson
2017-06-19  8:09                         ` Ulf Hansson
2017-06-19  9:02                         ` Peter Chen
2017-06-19  9:02                           ` Peter Chen
2017-06-19  9:02                           ` Peter Chen
2017-06-19  9:48                           ` Ulf Hansson
2017-06-19  9:48                             ` Ulf Hansson
2017-06-19  9:48                             ` Ulf Hansson
2017-06-20  2:37                             ` Peter Chen
2017-06-20  2:37                               ` Peter Chen
2017-06-20  2:37                               ` Peter Chen
2017-06-13  1:59 ` [PATCH v15 3/7] binding-doc: usb: usb-device: add optional properties for power sequence Peter Chen
2017-06-13  1:59   ` Peter Chen
2017-06-13  1:59   ` Peter Chen
2017-06-13  1:59 ` [PATCH v15 4/7] usb: core: add power sequence handling for USB devices Peter Chen
2017-06-13  1:59   ` Peter Chen
2017-06-13  1:59   ` Peter Chen
2017-06-13  1:59 ` [PATCH v15 5/7] ARM: dts: imx6qdl: Enable usb node children with <reg> Peter Chen
2017-06-13  1:59   ` Peter Chen
2017-06-13  1:59   ` Peter Chen
2017-06-13  1:59 ` [PATCH v15 6/7] ARM: dts: imx6qdl-udoo.dtsi: fix onboard USB HUB property Peter Chen
2017-06-13  1:59   ` Peter Chen
2017-06-13  1:59   ` Peter Chen
     [not found] ` <1497319166-17287-1-git-send-email-peter.chen-3arQi8VN3Tc@public.gmane.org>
2017-06-13  1:59   ` [PATCH v15 7/7] ARM: dts: imx6q-evi: Fix onboard hub reset line Peter Chen
2017-06-13  1:59     ` Peter Chen
2017-06-13  1:59     ` Peter Chen

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=20170614015338.GA4635@b29397-desktop \
    --to=hzpeterchen-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=arnd-r2nGTMty4D4@public.gmane.org \
    --cc=dbaryshkov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=festevam-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=frank.li-3arQi8VN3Tc@public.gmane.org \
    --cc=gary.bisson-Q5RJGjKts06CY9SHAMCTRUEOCMrvLtNR@public.gmane.org \
    --cc=heiko-4mtYJXux2i+zQB+pC5nmwQ@public.gmane.org \
    --cc=krzk-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-pm-u79uwXL29TY@public.gmane.org \
    --cc=mail-APzI5cXaD1zVlRWJc41N0YvC60bnQu0Y@public.gmane.org \
    --cc=mark.rutland-5wv7dgnIgG8@public.gmane.org \
    --cc=mka-F7+t8E8rja9g9hUCZPvPmw@public.gmane.org \
    --cc=pawel.moll-5wv7dgnIgG8@public.gmane.org \
    --cc=peter.chen-3arQi8VN3Tc@public.gmane.org \
    --cc=stephen.boyd-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org \
    --cc=stillcompiling-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=ulf.hansson-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=vaibhav.hiremath-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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.