From: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
To: "Rafael J. Wysocki" <rjw@sisk.pl>
Cc: "Toralf Förster" <toralf.foerster@gmx.de>,
cpufreq@vger.kernel.org,
"Linux PM list" <linux-pm@vger.kernel.org>,
"Viresh Kumar" <viresh.kumar@linaro.org>
Subject: Re: stable 3-10-3: strange output of "lsmod | grep ^acpi_cpufreq"
Date: Mon, 29 Jul 2013 17:14:25 +0530 [thread overview]
Message-ID: <51F65599.6050209@linux.vnet.ibm.com> (raw)
In-Reply-To: <10771278.LGR8ezfsZF@vostro.rjw.lan>
On 07/29/2013 05:19 PM, Rafael J. Wysocki wrote:
> On Monday, July 29, 2013 03:11:45 PM Srivatsa S. Bhat wrote:
>> On 07/29/2013 04:50 AM, Rafael J. Wysocki wrote:
>>> On Monday, July 29, 2013 12:43:59 AM Rafael J. Wysocki wrote:
>>>> On Monday, July 29, 2013 12:11:18 AM Rafael J. Wysocki wrote:
>>>>> On Sunday, July 28, 2013 12:21:22 PM Toralf Förster wrote:
>>>>>> On 07/28/2013 01:39 AM, Rafael J. Wysocki wrote:
>>>>>>> On Saturday, July 27, 2013 07:40:34 PM Toralf Förster wrote:
>>>>>>>> it gives at a ThinkPad T420:
>>>>>>>>
>>>>>>>> tfoerste@n22 ~/tmp $ lsmod | grep ^acpi_cpufreq
>>>>>>>> acpi_cpufreq 12902 2147483647
>>>>>>>
>>>>>>> That is -1, which indicates some module refcount woes.
>>>>>>
>>>>>> yes, ofc.
>>>>>>
>>>>>> The issue apears after 1 s2ram/resume cycle, before s2ram the refcount is 1.
>>>>>>
>>>>>>> I definitely can't see that with the mainline on my machines.
>>>>>>
>>>>>> It is in mainline too.
>>>>>
>>>>> Does the appended patch help?
>>>>
>>>> Actually, something as simple as this also should help:
>>>>
>>>> ---
>>>> From: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
>>>> Subject: cpufreq: Fix cpufreq driver module refcount balance after suspend/resume
>>>>
>>>> Since cpufreq_cpu_put() called by __cpufreq_remove_dev() drops the
>>>> driver module refcount, __cpufreq_remove_dev() causes that refcount
>>>> to become negative after a suspend/resume cycle, for example.
>>>>
>>>> To prevent this from happening make __cpufreq_remove_dev() put
>>>> the policy kobject only instead of calling cpufreq_cpu_put().
>>>
>>> Having a deeper look at it, though, I see that in fact the whole
>>> cpufreq_cpu_put() is needed if the CPU is not the last one for the given
>>> policy and is not needed at all otherwise (as described in the changelog
>>> of the patch below).
>>>
>>> Srivatsa, does this make sense to you?
>>>
>>
>> Code-wise, your patch looks good to me. But one thing in the existing code
>> struck me as a little strange.
>>
>> I'm assuming that the module_get() is used in the cpufreq core to ensure that
>> until the cpufreq core is managing (atleast one) CPU(s), the cpufreq backend
>> driver module (eg: acpi-cpufreq) can't be removed.
>
> Quite frankly, I'm not sure about that. If that were the case,
> cpufreq_add_dev() would not call module_put() which it does.
>
> That may be a bug, I agree, but that's not for the present release cycle. For
> now, we need to ensure that the reference counts are *balanced* .
>
Sure, in that case, I agree that your patch is the right fix at this point,
since it resolves the immediate problem that we have with the refcounts.
Reviewed-by: Srivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
Regards,
Srivatsa S. Bhat
next prev parent reply other threads:[~2013-07-29 11:44 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-27 17:40 stable 3-10-3: strange output of "lsmod | grep ^acpi_cpufreq" Toralf Förster
2013-07-27 23:39 ` Rafael J. Wysocki
2013-07-27 23:39 ` Rafael J. Wysocki
2013-07-28 8:08 ` Toralf Förster
2013-07-28 8:08 ` Srivatsa S. Bhat
2013-07-28 10:21 ` Toralf Förster
2013-07-28 22:11 ` Rafael J. Wysocki
2013-07-28 22:43 ` Rafael J. Wysocki
2013-07-28 23:20 ` Rafael J. Wysocki
2013-07-29 7:51 ` Viresh Kumar
2013-07-29 9:44 ` Srivatsa S. Bhat
2013-07-29 9:41 ` Srivatsa S. Bhat
2013-07-29 11:22 ` Viresh Kumar
2013-07-29 11:54 ` Rafael J. Wysocki
2013-07-29 11:54 ` Rafael J. Wysocki
2013-07-29 11:48 ` Srivatsa S. Bhat
2013-07-29 11:48 ` Srivatsa S. Bhat
2013-07-29 17:23 ` Toralf Förster
2013-07-29 20:19 ` Rafael J. Wysocki
2013-07-30 5:23 ` Viresh Kumar
2013-07-29 11:49 ` Rafael J. Wysocki
2013-07-29 11:44 ` Srivatsa S. Bhat [this message]
2013-07-29 12:04 ` Rafael J. Wysocki
2013-07-29 15:27 ` Srivatsa S. Bhat
2013-07-29 20:28 ` 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=51F65599.6050209@linux.vnet.ibm.com \
--to=srivatsa.bhat@linux.vnet.ibm.com \
--cc=cpufreq@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=rjw@sisk.pl \
--cc=toralf.foerster@gmx.de \
--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 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.