Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1362793
| From | Viresh Kumar <viresh.kumar@linaro.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH 3/3] cpufreq: Always update current frequency before startig governor |
| Date | 2016-03-22 15:50 +0100 |
| Message-ID | <rfvN7-5Sf-15@gated-at.bofh.it> (permalink) |
| References | <rf9jz-76M-11@gated-at.bofh.it> <rf9jA-76M-13@gated-at.bofh.it> <rflkJ-76l-1@gated-at.bofh.it> <rfvDs-5NV-21@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On 22-03-16, 15:33, Rafael J. Wysocki wrote:
> On Tuesday, March 22, 2016 09:00:32 AM Viresh Kumar wrote:
> > Why we did the same in process context earlier? And why it wouldn't be
> > a problem now, when we do it in interrupt context? Will IRQs be
> > disabled here? If so, then will you hit following ?
>
> I'm not sure I'm following.
Sorry about that.
> This is process context too.
>
> Look at the call sites of cpufreq_start_governor() (patch [1/3]):
> - cpufreq_offline() - process context
> - cpufreq_resume() - process context
I somehow thought that this is going to happen in interrupt context. :(
> - cpufreq_set_policy() - process context
> - cpufreq_add_policy_cpu() - process context
>
> Besides, calling cpufreq_governor() from interrupt context wouldn't reall work,
> because that acquires mutexes etc, like in cpufreq_governor_init().
>
> > static void __cpufreq_notify_transition(struct cpufreq_policy *policy,
> > struct cpufreq_freqs *freqs, unsigned int state)
> > {
> > BUG_ON(irqs_disabled());
> >
> > ...
> > }
> >
> > And will calling notifiers from interrupt-context just fine ?
>
> If your question is why the original code doesn't call cpufreq_update_policy()
> directly, I think the reason is because cpufreq_resume() used to be one of the
> syscore ops and *that* would have been run in interrupt context.
Yeah.
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
--
viresh
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 3/3] cpufreq: Always update current frequency before startig governor "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-03-21 15:50 +0100
Re: [PATCH 3/3] cpufreq: Always update current frequency before startig governor Viresh Kumar <viresh.kumar@linaro.org> - 2016-03-22 04:40 +0100
Re: [PATCH 3/3] cpufreq: Always update current frequency before startig governor "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2016-03-22 15:40 +0100
Re: [PATCH 3/3] cpufreq: Always update current frequency before startig governor Viresh Kumar <viresh.kumar@linaro.org> - 2016-03-22 15:50 +0100
csiph-web