From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: Viresh Kumar <viresh.kumar@linaro.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
Lists linaro-kernel <linaro-kernel@lists.linaro.org>,
"cpufreq@vger.kernel.org" <cpufreq@vger.kernel.org>,
"linux-pm@vger.kernel.org" <linux-pm@vger.kernel.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
Amit Daniel <amit.daniel@samsung.com>
Subject: Re: [RFC V2] cpufreq: make sure frequency transitions are serialized
Date: Wed, 19 Mar 2014 15:20:17 +0530 [thread overview]
Message-ID: <53296859.20801@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAKohpomrn25hBg5o1h8WWMM+d8o2OJJUmGEmXGvVk3BqP90HJQ@mail.gmail.com>
On 03/19/2014 02:50 PM, Viresh Kumar wrote:
> On 19 March 2014 14:47, Srivatsa S. Bhat
> <srivatsa.bhat@linux.vnet.ibm.com> wrote:
>> Wait, I think I remember. The problem was about dealing with drivers that
>> do asynchronous notification (those that have the ASYNC_NOTIFICATION flag
>> set). In particular, exynos-5440 driver sends out the POSTCHANGE notification
>> from a workqueue worker, much later than sending the PRECHANGE notification.
>>
>> From what I saw, this is how the exynos-5440 driver works:
>>
>> 1. ->target() is invoked, and the driver writes to a register and returns
>> to its caller.
>>
>> 2. An interrupt occurs that indicates that the frequency was changed.
>>
>> 3. The interrupt handler kicks off a worker thread which then sends out
>> the POSTCHANGE notification.
>
> Correct!!
>
>> So the important question here is, how does the exynos-5440 driver
>> protect itself from say 2 ->target() calls which occur in close sequence
>> (before allowing the entire chain for the first call to complete)?
>>
>> As far as I can see there is no such synchronization in the driver at
>> the moment. Adding Amit to CC for his comments.
>
> Yes, and that's what my patch is trying to fix. Where is the confusion?
Sorry, for a moment I got confused and thought that your patch addresses
the race conditions present in normal drivers alone, and not ASYNC_NOTIFICATION
drivers. But now I understand that your patch intends to fix both the
problems at once. I'll share my thoughts about the design in a separate
reply.
Regards,
Srivatsa S. Bhat
next prev parent reply other threads:[~2014-03-19 9:50 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-14 7:43 [RFC V2] cpufreq: make sure frequency transitions are serialized Viresh Kumar
2014-03-18 12:50 ` Srivatsa S. Bhat
2014-03-19 6:08 ` Viresh Kumar
2014-03-19 9:17 ` Srivatsa S. Bhat
2014-03-19 9:20 ` Viresh Kumar
2014-03-19 9:50 ` Srivatsa S. Bhat [this message]
2014-03-19 9:50 ` Srivatsa S. Bhat
2014-03-19 10:09 ` Viresh Kumar
2014-03-19 12:15 ` [RFC v3] cpufreq: Make " Srivatsa S. Bhat
2014-03-19 13:35 ` Viresh Kumar
2014-03-19 14:48 ` Srivatsa S. Bhat
2014-03-19 17:38 ` Srivatsa S. Bhat
2014-03-20 4:39 ` Viresh Kumar
2014-03-20 8:32 ` Srivatsa S. Bhat
2014-03-20 8:37 ` Viresh Kumar
2014-03-20 9:24 ` Srivatsa S. Bhat
2014-03-20 9:33 ` Viresh Kumar
2014-03-20 9:45 ` Srivatsa S. Bhat
2014-03-20 9:50 ` Viresh Kumar
2014-03-19 13:53 ` [RFC V2] cpufreq: make " Rafael J. Wysocki
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=53296859.20801@linux.vnet.ibm.com \
--to=srivatsa.bhat@linux.vnet.ibm.com \
--cc=amit.daniel@samsung.com \
--cc=cpufreq@vger.kernel.org \
--cc=linaro-kernel@lists.linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@rjwysocki.net \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).