Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1686452

Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant load-tracking support

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant load-tracking support
Date 2017-07-13 13:20 +0200
Message-ID <u2Kk2-4UU-13@gated-at.bofh.it> (permalink)
References <u0bJL-2Bf-3@gated-at.bofh.it> <u2m81-6pg-11@gated-at.bofh.it> <u2nQt-7wc-9@gated-at.bofh.it> <u2zeV-6fP-13@gated-at.bofh.it> <u2HYR-3iC-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Jul 13, 2017 at 02:18:04PM +0530, Viresh Kumar wrote:
> Workqueues or normal threads actually. Maybe I am completely wrong,
> but this is how I believe things are going to be:
> 
> Configuration: Both regulator and clk registers accessible over I2C
> bus.
> 
> Scheduler calls schedutil, which eventually calls cpufreq driver (w/o
> kthread). The cpufreq backend driver will queue a async request with
> callback (with regulator core) to update regulator's constraints
> (which can sleep as we need to talk over I2C). The callback will be
> called once regulator is programmed. And we return right after
> submitting the request with regulator core.
> 
> Now, I2C transfer will finish (i.e. regulator programmed) and the
> driver specific callback will get called. It will try to change the
> frequency now and wait (sleep) until it finishes. I hope the regulator
> core wouldn't call the driver callback from interrupt context but some
> sort of bottom half, maybe workqueue (That's what I was referring to
> earlier).
> 
> And finally the clk is programmed and the state machine finished.
> 
> > > From what I can
> > > tell an i2c bus does clk_prepare_enable() on registration and from that
> > > point on clk_enable() is usable from atomic contexts.
> 
> That assumes that we can access registers of the I2C controller
> atomically without sleeping. Not sure how many ARM platforms have I2C
> controller connected over a slow bus though.
> 
> > > But afaict clk
> > > stuff doesn't do interrupts at all.
> 
> The clk stuff may not need it if the clock controllers registers can
> be accessed atomically. But if (as in my example) the clk controller
> is also over the I2C bus, then the interrupt will be provided from I2C
> bus and clk routines would return only after transfer is done.

So no, that's not the idea at all.

The one thing we assume is that the I2C bus does indeed have interrupts
(which isn't a given per se, but lacking that we're completely hosed).

For interrupt enabled I2C busses, we must be able to write to their
registers from atomic context, otherwise the interrupts can't very well
work.

With that, you can drive the entire thing from the IRQ.


I don't believe anyone is quite as silly as to put the regulator on a
nested I2C; in which case I think you still _could_ do, but I'll just
class that with failure of using a polling I2C bus for your regulator.


As to the serialization, your driver can easily keep track of that and
not allow a new transition to start while a previous is still in
critical transit.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v2 00/10] arm, arm64: frequency- and cpu-invariant accounting support for task scheduler Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-06 12:00 +0200
  [PATCH v2 08/10] arm64: wire frequency-invariant accounting support up to the task scheduler Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-06 12:00 +0200
    Re: [PATCH v2 08/10] arm64: wire frequency-invariant accounting  support up to the task scheduler Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-06 12:50 +0200
  [PATCH v2 03/10] drivers base/arch_topology: frequency-invariant load-tracking support Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-06 12:00 +0200
    Re: [PATCH v2 03/10] drivers base/arch_topology: frequency-invariant  load-tracking support Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-06 12:50 +0200
      Re: [PATCH v2 03/10] drivers base/arch_topology: frequency-invariant  load-tracking support Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-07 19:00 +0200
  [PATCH v2 05/10] arm: wire frequency-invariant accounting support up to the task scheduler Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-06 12:00 +0200
    Re: [PATCH v2 05/10] arm: wire frequency-invariant accounting  support up to the task scheduler Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-06 12:50 +0200
  [PATCH v2 02/10] cpufreq: provide data for frequency-invariant load-tracking support Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-06 12:00 +0200
    Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-06 12:50 +0200
      Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant load-tracking support "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-07 00:50 +0200
      Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-07 18:10 +0200
        Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support "Rafael J. Wysocki" <rafael@kernel.org> - 2017-07-07 18:20 +0200
          Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-07 19:10 +0200
            Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant load-tracking support "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-08 14:20 +0200
              Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-10 09:00 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant load-tracking support "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-10 15:00 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-11 08:50 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-11 17:30 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Sudeep Holla <sudeep.holla@arm.com> - 2017-07-13 14:50 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-13 15:10 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Sudeep Holla <sudeep.holla@arm.com> - 2017-07-13 16:10 +0200
              Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Peter Zijlstra <peterz@infradead.org> - 2017-07-10 11:40 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-10 11:50 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-10 12:40 +0200
              Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-10 14:10 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-11 08:10 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-11 17:10 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant load-tracking support "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-11 17:10 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-11 17:20 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-12 06:10 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Peter Zijlstra <peterz@infradead.org> - 2017-07-12 10:40 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-12 11:30 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Peter Zijlstra <peterz@infradead.org> - 2017-07-12 13:20 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant load-tracking support "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2017-07-13 01:30 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Peter Zijlstra <peterz@infradead.org> - 2017-07-13 10:00 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-13 10:50 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Peter Zijlstra <peterz@infradead.org> - 2017-07-13 13:20 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Sudeep Holla <sudeep.holla@arm.com> - 2017-07-13 16:10 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Peter Zijlstra <peterz@infradead.org> - 2017-07-13 16:50 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Sudeep Holla <sudeep.holla@arm.com> - 2017-07-13 17:10 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Sudeep Holla <sudeep.holla@arm.com> - 2017-07-13 15:00 +0200
                Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Sudeep Holla <sudeep.holla@arm.com> - 2017-07-13 14:50 +0200
        Re: [PATCH v2 02/10] cpufreq: provide data for frequency-invariant  load-tracking support Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-10 08:50 +0200
  [PATCH v2 04/10] arm: wire cpufreq input data for frequency-invariant accounting up to the arch Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-06 12:00 +0200
    Re: [PATCH v2 04/10] arm: wire cpufreq input data for  frequency-invariant accounting up to the arch Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-06 12:50 +0200
      Re: [PATCH v2 04/10] arm: wire cpufreq input data for  frequency-invariant accounting up to the arch Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-10 17:20 +0200
        Re: [PATCH v2 04/10] arm: wire cpufreq input data for  frequency-invariant accounting up to the arch Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-11 08:40 +0200
  [PATCH v2 09/10] arm64: wire cpu-invariant accounting support up to the task scheduler Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-06 12:00 +0200
    Re: [PATCH v2 09/10] arm64: wire cpu-invariant accounting support up  to the task scheduler Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-06 12:50 +0200
  [PATCH v2 06/10] arm: wire cpu-invariant accounting support up to the task scheduler Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-06 12:00 +0200
    Re: [PATCH v2 06/10] arm: wire cpu-invariant accounting support up  to the task scheduler Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-06 12:50 +0200
  [PATCH v2 01/10] drivers base/arch_topology: free cpumask cpus_to_visit Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-06 12:00 +0200
    Re: [PATCH v2 01/10] drivers base/arch_topology: free cpumask  cpus_to_visit Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-06 12:30 +0200
      Re: [PATCH v2 01/10] drivers base/arch_topology: free cpumask  cpus_to_visit Juri Lelli <juri.lelli@arm.com> - 2017-07-06 13:00 +0200
        Re: [PATCH v2 01/10] drivers base/arch_topology: free cpumask  cpus_to_visit Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-06 13:20 +0200
          Re: [PATCH v2 01/10] drivers base/arch_topology: free cpumask  cpus_to_visit Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-07 18:00 +0200
  [PATCH v2 10/10] drivers base/arch_topology: inline cpu- and frequency-invariant accounting Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-06 12:00 +0200
    Re: [PATCH v2 10/10] drivers base/arch_topology: inline cpu- and  frequency-invariant accounting Viresh Kumar <viresh.kumar@linaro.org> - 2017-07-06 13:00 +0200
      Re: [PATCH v2 10/10] drivers base/arch_topology: inline cpu- and  frequency-invariant accounting Dietmar Eggemann <dietmar.eggemann@arm.com> - 2017-07-10 17:20 +0200

csiph-web