From: Lukasz Luba <l.luba@partner.samsung.com>
To: Matthias Kaehlcke <mka@chromium.org>
Cc: MyungJoo Ham <myungjoo.ham@samsung.com>,
Kyungmin Park <kyungmin.park@samsung.com>,
Chanwoo Choi <cw00.choi@samsung.com>,
Thierry Reding <thierry.reding@gmail.com>,
Jonathan Hunter <jonathanh@nvidia.com>,
linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-tegra@vger.kernel.org
Subject: Re: [PATCH 4/4] PM / devfreq: Handle monitor start/stop in the devfreq core
Date: Fri, 15 Feb 2019 14:07:38 +0100 [thread overview]
Message-ID: <194a0fba-3e39-d577-810d-de300e8b4edd@partner.samsung.com> (raw)
In-Reply-To: <20190214190741.GC117604@google.com>
Hi Matthias,
On 2/14/19 8:07 PM, Matthias Kaehlcke wrote:
> Hi Lukasz,
>
> On Thu, Feb 14, 2019 at 07:01:36PM +0100, Lukasz Luba wrote:
>> Hi Matthias,
>>
>> I have compiled and run your changes on Odroid xu3 and v5.0-rc6.
>> There are kernel warnings because of mutex not held in function
>> devfreq_monitor_[start|stop]() in use cases:
>> 1) a few times during registration of new devices devfreq_add_device()
>> 2) poking the device from sysfs
>
> Thanks testing!
>
> I messed up carrying over changes from my v4.19 device kernel
> to the tree used for upstreaming :(
>
> Do you still see warnings with the below patch?
No, the warnings are no longer present in the log. The patch solves it.
Regards,
Lukasz
>
> Thanks
>
> Matthias
>
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index a42c37543c190..866fe711b43ca 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -440,7 +440,6 @@ static void devfreq_monitor_stop(struct devfreq *devfreq)
>
> mutex_lock(&devfreq->lock);
> devfreq->monitor_state = DEVFREQ_MONITOR_STOPPED;
> - mutex_unlock(&devfreq->lock);
> }
>
> /**
> @@ -596,7 +595,9 @@ static int governor_start(struct devfreq *devfreq)
> return err;
> }
>
> + mutex_lock(&devfreq->lock);
> devfreq_monitor_start(devfreq);
> + mutex_unlock(&devfreq->lock);
>
> return 0;
> }
> @@ -614,7 +615,9 @@ static int governor_stop(struct devfreq *devfreq)
> "mutex must *not* be held by the caller\n"))
> return -EINVAL;
>
> + mutex_lock(&devfreq->lock);
> devfreq_monitor_stop(devfreq);
> + mutex_unlock(&devfreq->lock);
>
> err = devfreq->governor->event_handler(devfreq, DEVFREQ_GOV_STOP, NULL);
> if (err) {
>
>
prev parent reply other threads:[~2019-02-15 13:07 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-14 1:30 [PATCH 0/4] PM / devfreq: Refactor load monitoring Matthias Kaehlcke
2019-02-14 1:30 ` [PATCH 1/4] PM / devfreq: Track overall load monitor state instead of 'stop_polling' Matthias Kaehlcke
2019-02-14 14:25 ` Chanwoo Choi
2019-02-14 16:59 ` Matthias Kaehlcke
2019-02-14 23:47 ` Chanwoo Choi
2019-02-14 1:30 ` [PATCH 2/4] PM / devfreq: Handle monitor suspend/resume in the devfreq core Matthias Kaehlcke
2019-02-14 14:10 ` Chanwoo Choi
2019-02-14 17:47 ` Matthias Kaehlcke
2019-02-14 1:30 ` [PATCH 3/4] PM / devfreq: Add devfreq_governor_start/stop() Matthias Kaehlcke
2019-02-14 14:12 ` Chanwoo Choi
2019-02-14 14:32 ` Chanwoo Choi
2019-02-14 18:32 ` Matthias Kaehlcke
2019-02-14 18:30 ` Matthias Kaehlcke
2019-02-14 1:30 ` [PATCH 4/4] PM / devfreq: Handle monitor start/stop in the devfreq core Matthias Kaehlcke
2019-02-14 14:17 ` Chanwoo Choi
2019-02-14 19:28 ` Matthias Kaehlcke
2019-02-14 23:42 ` Chanwoo Choi
2019-02-15 0:19 ` Matthias Kaehlcke
2019-02-15 0:33 ` Chanwoo Choi
2019-02-15 22:56 ` Matthias Kaehlcke
2019-02-18 11:22 ` Chanwoo Choi
2019-02-14 18:01 ` Lukasz Luba
2019-02-14 19:07 ` Matthias Kaehlcke
2019-02-15 13:07 ` Lukasz Luba [this message]
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=194a0fba-3e39-d577-810d-de300e8b4edd@partner.samsung.com \
--to=l.luba@partner.samsung.com \
--cc=cw00.choi@samsung.com \
--cc=jonathanh@nvidia.com \
--cc=kyungmin.park@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=mka@chromium.org \
--cc=myungjoo.ham@samsung.com \
--cc=thierry.reding@gmail.com \
/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).