All of lore.kernel.org
 help / color / mirror / Atom feed
From: Viresh Kumar <viresh.kumar@linaro.org>
To: Pi-Cheng Chen <pi-cheng.chen@linaro.org>
Cc: Mike Turquette <mturquette@linaro.org>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	Mark Rutland <mark.rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
	Linaro Kernel Mailman List <linaro-kernel@lists.linaro.org>,
	linux-mediatek@lists.infradead.org
Subject: Re: [PATCH 2/2] cpufreq: mediatek: Add MT8173 cpufreq driver
Date: Wed, 24 Jun 2015 14:26:58 +0530	[thread overview]
Message-ID: <20150624085658.GF27188@linux> (raw)
In-Reply-To: <CALx668UUUCzswiXyM9e4v9fhu6PTXq5DLu_O3swTPhJUjJPBFg@mail.gmail.com>

On 24-06-15, 16:44, Pi-Cheng Chen wrote:
> One reason to put those initialization and resource allocation in probe is
> that it's easier to handle the return value -PROBE_DEFER from clock
> and regulator framework when trying to get clocks and regulators
> consumed by cpufreq driver.

This is the sequence of events if you move these things to ->init().

- your driver's probe()
  -> cpufreq_register_driver()
    -> init()
      -> clk/reg get, failed, return -EPROBE_DEFER

And the failure here will be propagated to probe(). So, it should
work IMHO.

> The other reason is when the whole system is resuming from suspend,
> the other subsystem e.g. i2c on which cpufreq driver depends might not
> ready yet during cpufreq driver initialization. In this case, the cpufreq
> driver will be blocked when trying to get resources e.g. regulator on i2c
> bus, and the whole system will stuck for seconds.

That's something else you must investigate on. This dependency should
be resolved in some other way, I thought DT might have taken care of
such dependencies.

-- 
viresh

WARNING: multiple messages have this Message-ID (diff)
From: viresh.kumar@linaro.org (Viresh Kumar)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 2/2] cpufreq: mediatek: Add MT8173 cpufreq driver
Date: Wed, 24 Jun 2015 14:26:58 +0530	[thread overview]
Message-ID: <20150624085658.GF27188@linux> (raw)
In-Reply-To: <CALx668UUUCzswiXyM9e4v9fhu6PTXq5DLu_O3swTPhJUjJPBFg@mail.gmail.com>

On 24-06-15, 16:44, Pi-Cheng Chen wrote:
> One reason to put those initialization and resource allocation in probe is
> that it's easier to handle the return value -PROBE_DEFER from clock
> and regulator framework when trying to get clocks and regulators
> consumed by cpufreq driver.

This is the sequence of events if you move these things to ->init().

- your driver's probe()
  -> cpufreq_register_driver()
    -> init()
      -> clk/reg get, failed, return -EPROBE_DEFER

And the failure here will be propagated to probe(). So, it should
work IMHO.

> The other reason is when the whole system is resuming from suspend,
> the other subsystem e.g. i2c on which cpufreq driver depends might not
> ready yet during cpufreq driver initialization. In this case, the cpufreq
> driver will be blocked when trying to get resources e.g. regulator on i2c
> bus, and the whole system will stuck for seconds.

That's something else you must investigate on. This dependency should
be resolved in some other way, I thought DT might have taken care of
such dependencies.

-- 
viresh

  reply	other threads:[~2015-06-24  8:56 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-08 12:29 [PATCH 0/2] Add Mediatek MT8173 cpufreq driver Pi-Cheng Chen
2015-06-08 12:29 ` Pi-Cheng Chen
2015-06-08 12:29 ` [PATCH 1/2] dt-bindings: mediatek: Add MT8173 cpufreq driver binding Pi-Cheng Chen
2015-06-08 12:29   ` Pi-Cheng Chen
2015-06-23 15:31   ` Pi-Cheng Chen
2015-06-23 15:31     ` Pi-Cheng Chen
2015-06-24  1:06     ` Viresh Kumar
2015-06-24  1:06       ` Viresh Kumar
2015-06-24  8:57       ` Pi-Cheng Chen
2015-06-24  8:57         ` Pi-Cheng Chen
2015-06-24  9:00         ` Viresh Kumar
2015-06-24  9:00           ` Viresh Kumar
2015-06-25  6:20       ` Pi-Cheng Chen
2015-06-25  6:20         ` Pi-Cheng Chen
2015-06-25  6:20         ` Pi-Cheng Chen
2015-06-29 21:53       ` Michael Turquette
2015-06-29 21:53         ` Michael Turquette
2015-07-01  2:01         ` Pi-Cheng Chen
2015-07-01  2:01           ` Pi-Cheng Chen
2015-06-08 12:29 ` [PATCH 2/2] cpufreq: mediatek: Add MT8173 cpufreq driver Pi-Cheng Chen
2015-06-08 12:29   ` Pi-Cheng Chen
     [not found]   ` <1433766561-1330-3-git-send-email-pi-cheng.chen-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-06-09  9:17     ` Paul Bolle
2015-06-09  9:17       ` Paul Bolle
2015-06-09  9:17       ` Paul Bolle
2015-06-10  3:37       ` Pi-Cheng Chen
2015-06-10  3:37         ` Pi-Cheng Chen
2015-06-10  3:37         ` Pi-Cheng Chen
2015-06-22 11:45   ` Viresh Kumar
2015-06-22 11:45     ` Viresh Kumar
2015-06-22 11:45     ` Viresh Kumar
2015-06-23 15:25     ` Pi-Cheng Chen
2015-06-23 15:25       ` Pi-Cheng Chen
2015-06-23 15:25       ` Pi-Cheng Chen
2015-06-24  0:57       ` Viresh Kumar
2015-06-24  0:57         ` Viresh Kumar
2015-06-24  8:44         ` Pi-Cheng Chen
2015-06-24  8:44           ` Pi-Cheng Chen
2015-06-24  8:44           ` Pi-Cheng Chen
2015-06-24  8:56           ` Viresh Kumar [this message]
2015-06-24  8:56             ` Viresh Kumar
2015-06-24  9:09             ` Pi-Cheng Chen
2015-06-24  9:09               ` Pi-Cheng Chen
     [not found] ` <1433766561-1330-1-git-send-email-pi-cheng.chen-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2015-06-09  0:26   ` [PATCH 0/2] Add Mediatek " Pi-Cheng Chen
2015-06-09  0:26     ` Pi-Cheng Chen
2015-06-09  0:26     ` Pi-Cheng 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=20150624085658.GF27188@linux \
    --to=viresh.kumar@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=linaro-kernel@lists.linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=matthias.bgg@gmail.com \
    --cc=mturquette@linaro.org \
    --cc=pi-cheng.chen@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.