All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Rafael J. Wysocki" <rjw@rjwysocki.net>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	linaro-kernel@lists.linaro.org, linux-pm@vger.kernel.org,
	linux-kernel@vger.kernel.org, pi-cheng.chen@linaro.org
Subject: Re: [PATCH] bus: subsys: propagate errors from subsys interface's ->add_dev()
Date: Fri, 31 Jul 2015 15:41:31 +0200	[thread overview]
Message-ID: <1728127.lyUO7fLBpR@vostro.rjw.lan> (raw)
In-Reply-To: <20150731060907.GO17794@linux>

On Friday, July 31, 2015 11:39:07 AM Viresh Kumar wrote:
> On 30-07-15, 20:53, Rafael J. Wysocki wrote:
> > Well, on ACPI systems we actually do probe CPU devices.  We have a processor
> > driver there that binds to CPU devices and the cpufreq driver is just a
> > frontend to that.
> 
> Hmm, maybe I need to look at that in detail..
> 
> > So question is what prevents DT-based systems from doing it analogously.
> 
> Don't have an answer to it yet.
> 
> > Now, even if you use a fake platform device for that (I'm sure there are
> > reasons for doing that, but I'd very much like them to be explained),
> 
> The other reason apart from the EPROBE_DEFER thing was to identify the
> right driver for a platform. For multiplatform kernels, there can be
> multiple cpufreq drivers present in the kernel and there was no other
> way to identify the right driver platform wants to probe.
> 
> > then
> > all of the information on dependencies should already be available to the
> > ->probe callback of that device's driver, so it can check them before
> > registering the cpufreq interface, can't it?
> 
> That's what we try to do today for cpufreq-dt, for example. But that
> has to be done for every possible policy the system can have as all
> might have separate resources to allocate. For cpufreq-dt, we do it
> only for cpu0 today, and assume others will work as well if cpu0 can.
> 
> The real deal is that we need a probe() per policy here, for which
> init() fitted well :)
> 
> > Essentially, what you're suggesting to do is something like: Make the ->probe
> > of one device's driver register a subsys interface for a specific bus type
> > and check what ->add_dev of that interface returns for each device on that
> > bus and if that is -EPROBE_DEFER, return it as its own return value.  Do you
> > honestly think this is a good design?
> 
> No. I don't really thing so. That's why I was asking for suggestions
> to do it proper. Maybe processor driver is the way to look for, I will
> investigate further on that.
> 
> But until the time that is done, and I expect that to take some time,
> can't we check the return value of ->add_dev()?

As I said, either do it everywhere, or do it nowhere (in which case it can
be void).  Doing it in one place only is plain confusing and generally
incorrect.

Thanks,
Rafael


  reply	other threads:[~2015-07-31 13:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26  9:02 [PATCH] bus: subsys: propagate errors from subsys interface's ->add_dev() Viresh Kumar
2015-07-29 21:19 ` Greg KH
2015-07-29 23:01   ` Rafael J. Wysocki
2015-07-29 22:37     ` Greg KH
2015-07-29 23:29       ` Rafael J. Wysocki
2015-07-29 23:34         ` Greg KH
2015-07-30  3:44         ` Viresh Kumar
2015-07-30 18:53           ` Rafael J. Wysocki
2015-07-31  6:09             ` Viresh Kumar
2015-07-31 13:41               ` Rafael J. Wysocki [this message]
2015-07-30  3:25   ` Viresh Kumar

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=1728127.lyUO7fLBpR@vostro.rjw.lan \
    --to=rjw@rjwysocki.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pi-cheng.chen@linaro.org \
    --cc=viresh.kumar@linaro.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.