From: Dave Jones <davej@redhat.com>
To: Ingo Molnar <mingo@elte.hu>,
linux-kernel@vger.kernel.org, "Rafael J. Wysocki" <rjw@sisk.pl>,
venkatesh.pallipadi@intel.com
Subject: Re: [crash] kernel BUG at drivers/cpufreq/cpufreq.c:1060!
Date: Wed, 12 Dec 2007 13:18:28 -0500 [thread overview]
Message-ID: <20071212181828.GA27675@redhat.com> (raw)
In-Reply-To: <20071212164013.GA2359@redhat.com>
On Wed, Dec 12, 2007 at 11:40:13AM -0500, Dave Jones wrote:
> > powernow-k8: Found 1 AMD Athlon(tm) 64 X2 Dual Core Processor 3800+ processors (1 cpu cores) (version 2.20.00)
> > powernow-k8: BIOS error - no PSB or ACPI _PSS objects
> > ------------[ cut here ]------------
> > kernel BUG at drivers/cpufreq/cpufreq.c:1060!
>
> The actual BUG you hit is
>
> if (unlikely(lock_policy_rwsem_write(cpu)))
> BUG();
>
> It _looks_ like we're leaking a refcount on that lock, but
> I don't see where. It's a shame you can't reproduce this easily,
> as cpufreq.debug=7 would give us more clues.
> (And CONFIG_CPUFREQ_DEBUG=y)
So we're missing some unlocks in some error paths.
It's feasible you hit one of those.
This patch should be the fix for that.
Dave
diff --git a/drivers/cpufreq/cpufreq.c b/drivers/cpufreq/cpufreq.c
index 5e626b1..79581fa 100644
--- a/drivers/cpufreq/cpufreq.c
+++ b/drivers/cpufreq/cpufreq.c
@@ -841,19 +841,25 @@ static int cpufreq_add_dev (struct sys_device * sys_dev)
drv_attr = cpufreq_driver->attr;
while ((drv_attr) && (*drv_attr)) {
ret = sysfs_create_file(&policy->kobj, &((*drv_attr)->attr));
- if (ret)
+ if (ret) {
+ unlock_policy_rwsem_write(cpu);
goto err_out_driver_exit;
+ }
drv_attr++;
}
if (cpufreq_driver->get){
ret = sysfs_create_file(&policy->kobj, &cpuinfo_cur_freq.attr);
- if (ret)
+ if (ret) {
+ unlock_policy_rwsem_write(cpu);
goto err_out_driver_exit;
+ }
}
if (cpufreq_driver->target){
ret = sysfs_create_file(&policy->kobj, &scaling_cur_freq.attr);
- if (ret)
+ if (ret) {
+ unlock_policy_rwsem_write(cpu);
goto err_out_driver_exit;
+ }
}
spin_lock_irqsave(&cpufreq_driver_lock, flags);
--
http://www.codemonkey.org.uk
next prev parent reply other threads:[~2007-12-12 18:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-12 9:11 [crash] kernel BUG at drivers/cpufreq/cpufreq.c:1060! Ingo Molnar
2007-12-12 9:57 ` Ingo Molnar
2007-12-12 10:21 ` Alexey Dobriyan
2007-12-12 10:35 ` Ingo Molnar
2007-12-12 16:40 ` Dave Jones
2007-12-12 18:18 ` Dave Jones [this message]
2007-12-13 10:17 ` Ingo Molnar
2007-12-13 17:50 ` Dave Jones
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=20071212181828.GA27675@redhat.com \
--to=davej@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=rjw@sisk.pl \
--cc=venkatesh.pallipadi@intel.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